Add plan optimizer rules and push expressions - #9196
Conversation
Merging this PR will improve performance by 20.44%
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ⚡ | Simulation | cold_misaligned[(64, 256)] |
5.3 ms | 4.4 ms | +20.44% |
Tip
Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.
Comparing vortex-plan-rules (5361eb1) with develop (15c73f3)
Footnotes
-
89 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
3675240 to
79b24a6
Compare
29488db to
6c8e44e
Compare
08b86f2 to
825351d
Compare
825351d to
da8e42f
Compare
15deec3 to
9b8ffd7
Compare
9b8ffd7 to
e2533f2
Compare
e2533f2 to
b09ebfd
Compare
b09ebfd to
82141f9
Compare
82141f9 to
a1e7377
Compare
a1e7377 to
e21444d
Compare
| // A residual expression may remain above the same child kind after a successful rewrite. | ||
| // Do not immediately apply that rule again; recursively optimize only the retained child. | ||
| let child_type = eval.child_plan()?.id(); | ||
| let blocked = (child_type == previous_child_type).then_some(previous_child_type); |
There was a problem hiding this comment.
This doesn't work for nested field access since the next level is the same planid, not sure if this is handled in a follow up but you likely want to return some kind of continuation token
2cd6302 to
ce79a77
Compare
8eee7bd to
ad5bb90
Compare
Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk>
ad5bb90 to
5361eb1
Compare
Summary
PlanParentReduceRuleand type-erased adapter APIs for child-driven physical-plan rewritesPlanParentRuleSetwhose first successful rewrite winsEvalreductions forConcat,Take,RowIdx, andPackRowIdx, including the emptypack()used byCOUNT(*)Why these are one change
The rule interfaces have no useful behavior without registered rules, and the pushdown implementation defines the invariants the interfaces must support. Keeping them together makes the API reviewable against its real consumers and leaves one complete optimizer commit. This PR therefore absorbs the former #9166, which is closed with no remaining implementation diff.
Safety
Stack
This is the first active PR after merged plan-model PR #9142. It is followed directly by #9187.
Checks
RUSTC_WRAPPER= cargo test -p vortex-layout— 229 passedRUSTC_WRAPPER= cargo clippy -p vortex-layout --all-targets --all-features -- -D warningscargo +nightly fmt --all -- --checkgit diff --check