Repository navigation
Use InlinedVector for rpn_stack in sparse checkInHyperrectangle - #110153
alexey-milovidov merged 3 commits into
Conversation
The sparse overload of KeyCondition::checkInHyperrectangle (the default path with use_lightweight_primary_key_index_analysis) heap-allocated its rpn_stack on every invocation, while the non-sparse overload already uses absl::InlinedVector<BoolMask, 16>. This function runs once per hyperrectangle check during mark filtering, so the allocation is hot. 5-26% less time in FilteringMarksWithPrimaryKey across IN/point/range/ OR/NOT IN/multi-column-key query shapes, ~6% for a typical large IN.
|
Workflow [PR], commit [19ae721] Summary: ✅
AI ReviewSummaryThis PR replaces the sparse Final VerdictStatus: ✅ Approve |
|
📊 Cloud Performance Report ✅ AI verdict: This PR swaps a std::vector for an absl::InlinedVector in the primary-key index RPN stack (KeyCondition::checkInHyperrectangle), avoiding heap allocation during hyperrectangle checks. That only helps queries with selective primary-key filters; the two flagged ClickBench improvements (Q4 and Q15) are full-scan aggregations that never exercise that path, and both show essentially flat CPU (~2.6s) with wall-time-only deltas of -21.4% and -21.7%. Those readings are consistent with run-to-run variance rather than a real effect of this change, so Q4 stays no_change and Q15 is downgraded to not_sure. No cross-query pattern worth flagging. clickbenchFlagged queries (1 of 43)
Change = percent below ×2; the ratio of medians (×N faster/slower) beyond, where percent understates the scale. q-value = BH-FDR adjusted p; smaller is stronger evidence. MIRAI flags a query when q < fdr_q (default 0.10) — the value the verdict is based on. tpch_adapted_1_official🟢 No significant changes Debug info
|
|
@alexey-milovidov I don't think those test failures are caused by this change. |
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered: 2/2 (100.00%) · Uncovered code |
…se-inlined-rpn-stack Use InlinedVector for rpn_stack in sparse checkInHyperrectangle
The sparse overload of
KeyCondition::checkInHyperrectangle(the default path withuse_lightweight_primary_key_index_analysis) heap-allocated itsrpn_stackon every invocation, while the non-sparse overload already usesabsl::InlinedVector<BoolMask, 16>. The function runs once per hyperrectangle check during mark filtering, so the vector construction is hot: in the release binary, the firstemplace_backalways took the allocating grow path.Benchmarks (100 parts × 1M rows,
index_granularity = 256, interleaved A/B runs) show 5-26% less time inFilteringMarksWithPrimaryKeyacross 13 query shapes (INwith 50/500/5000 values, point lookups, ranges,ORchains,NOT IN, multi-column keys, >16-deep nested conditions), ~6% for a typical largeIN. Patched binary won 71 of 75 interleaved run pairs (sign test p = 6.8e-17); no shape regressed, including the >16-depth case that spills to the heap.Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Avoid a heap allocation per hyperrectangle check in primary key index analysis, speeding up mark filtering by 5-26% depending on the query shape.
Version info
26.7.1.949(included in26.7and later)