feat(cost): estimate physical DAG resources analytically - #332
Merged
Merged
Conversation
zzylol
marked this pull request as ready for review
September 3, 2026 03:08
zzylol
force-pushed
the
feat/analytical-resource-cost-323
branch
from
September 3, 2026 16:02
87e8e32 to
8fdfdbf
Compare
Contributor
Author
|
@milindsrivastava1997 @Selvomega Just labeling you as reviewers for this feature and future check |
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.
Why
The planner needs resource estimates derived from physical work, rather than the previous structural node count. CPU work, peak memory, and source scan bytes must remain separate so later ranking can apply an explicit calibration without mixing rows, groups, and bytes.
What
How
Each operator owns an algorithmic resource formula. Child output statistics flow across edges; source bytes are charged only at physical scans; peak memory follows concurrent state requirements; shared nodes are charged once. Generic semantic checks reject evidence such as expanding filters, aggregate outputs larger than the group count, or Top-K outputs larger than k.
Before
A larger expression tree could appear more expensive even when it avoided most scans, and contradictory statistics could silently produce a favorable estimate.
After
Every supported physical DAG produces independently inspectable CPU, memory, and I/O estimates, or is unavailable with a concrete validation error.
Validation
cargo test -p asap-aware-mappingcargo clippy --workspace --all-targets --all-features -- -D warningscargo fmt --all -- --checkStack base. #326 adds comparison-scope and evidence-provider validation.