临时方案 Lazy mat pullup v1#63695
Closed
englefly wants to merge 1 commit into
Closed
Conversation
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
Contributor
Author
|
run buildall |
Issue Number: None
Related PR: None
Problem Summary: TopN(Project(scan)) can compute output-only expressions before TopN even when those aliases are not used by ordering or filtering. This makes nested expression inputs such as struct_col.city operative before TopN and prevents lazy materialization. Generalize the Project-under-TopN pull-up rule for safe non-aggregate cases and make OperativeColumnDerive propagate Project alias inputs only when the alias is already operative, so output-only aliases can be computed after TopN.
Improve TopN plans by delaying output-only Project expressions until after TopN, enabling lazy materialization for their input columns.
- Test: Regression test / Build
- ./build.sh --fe
- ./run-regression-test.sh --run -d nereids_rules_p0/column_pruning -s topn_project_pullup_column_pruning -forceGenOut
- ./run-regression-test.sh --run -d nereids_rules_p0/column_pruning -s topn_project_pullup_column_pruning
- Behavior changed: Yes (optimizer can place output-only Project expressions above TopN)
- Does this need documentation: No
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
[improvement](fe) Split nested project under topn
Issue Number: None
Related PR: None
Problem Summary: Pulling a whole expression such as substring(struct_element(struct_col, 'city'), 1) above TopN prevents the scan-side project from exposing struct_element to NestedColumnPruning. Split PreferPushDownProject subexpressions into a lower Project so struct_element remains below TopN and can generate struct_col.city access paths, while the upper Project keeps the remaining substring work after TopN. Root PreferPushDownProject aliases are kept below TopN to avoid repeatedly pulling the generated lower Project back above TopN.
Improve TopN project pull-up plans so nested struct_element subexpressions can still participate in nested column pruning.
- Test: Regression test / Checkstyle / Fast compile
- tools/fast-compile-fe.sh
- cd fe && mvn checkstyle:check -pl fe-core -q
- ./run-regression-test.sh --run -d nereids_rules_p0/column_pruning -s topn_project_pullup_column_pruning -forceGenOut
- ./run-regression-test.sh --run -d nereids_rules_p0/column_pruning -s topn_project_pullup_column_pruning
- Behavior changed: Yes (TopN project pull-up can split nested subexpressions to preserve nested column pruning)
- Does this need documentation: No
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
3f6d40f to
3ae1b31
Compare
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.
What problem does this PR solve?
Issue Number: close #xxx
Related PR: #xxx
Problem Summary:
Release note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)