Avoid reading fields for empty projections - #9365
Draft
joseph-isaacs wants to merge 1 commit into
Draft
Conversation
Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk>
joseph-isaacs
force-pushed
the
ji/vx-plan-ci
branch
from
August 11, 2026 20:50
ca0bb6f to
cecbc8f
Compare
joseph-isaacs
force-pushed
the
ji/plan-count-star
branch
from
August 11, 2026 20:50
00cd077 to
a836fa0
Compare
Merging this PR will improve performance by 19.44%
Performance Changes
Tip Curious why this is faster? Comment Comparing Footnotes
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
RowIdx, allowing an emptypack()projection to reach struct-field pruningPackas a row-count-preserving scan leafRoot cause
COUNT(*)reaches the V2 scanner as an emptypack()projection. Because it references neither the generated row index nor child values,partition_boundreturns zero partitions.ExpressionRowIdxRulepreviously handled only one or two partitions, so the expression stayed aboveRowIdxand the full struct source remained materialized.After pruning all fields, the resulting childless
Packalso needs to contribute the scan-range endpoint; otherwise natural split planning schedules no task and loses the row count.Stack
This is the final top-of-stack PR, based on #9341. During this update the complete published chain was restacked onto the current #9142 head and verified after publication:
#9142 → #9196 → #9166 → #9187 → #9240 → #9244 → #9254 → #9341 → this PR
The benchmark-only full-stack sibling #9342 was also rebuilt on current
developand now contains this change.Checks
cargo +nightly fmt --all -- --checkcargo test -p vortex-layout -p vortex-scan-v2 -p vortex-datafusioncargo clippy -p vortex-layout -p vortex-scan-v2 -p vortex-datafusion --all-targets --all-features -- -D warningscargo clippy --all-targets --all-features -- -D warningsgit diff --check