-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[opt](nereids) add project under aggregate to enable extract common sub expression #40473
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Thank you for your contribution to Apache Doris. Since 2024-03-18, the Document has been moved to doris-website. |
|
run buildall |
TPC-H: Total hot run time: 40696 ms |
|
run buildall |
TPC-H: Total hot run time: 40961 ms |
|
run buildall |
TPC-H: Total hot run time: 40508 ms |
TPC-DS: Total hot run time: 188016 ms |
|
run buildall |
2 similar comments
|
run buildall |
|
run buildall |
|
run buildall |
TPC-H: Total hot run time: 42459 ms |
TPC-DS: Total hot run time: 193345 ms |
ClickBench: Total hot run time: 31.23 s |
|
run buildall |
|
run buildall |
TPC-H: Total hot run time: 41630 ms |
TPC-DS: Total hot run time: 198226 ms |
ClickBench: Total hot run time: 31.71 s |
|
run buildall |
TPC-H: Total hot run time: 41866 ms |
TPC-DS: Total hot run time: 193735 ms |
ClickBench: Total hot run time: 31.89 s |
|
run p0 |
|
run cloud_p0 |
1 similar comment
|
run cloud_p0 |
|
PR approved by at least one committer and no changes requested. |
|
PR approved by anyone and no changes requested. |
…ub expression (#40473) ## Proposed changes project aggregate function parameters, and then apply common_sub_expression opt by CommonSubExpressionOpt post processor. example: agg( sum(A+B), avg(A+B)) +--->Scan(T) => agg(sum(x) , avg(x)) +---> project (A+B as x) +--->Scan(T) tpcds 64 changed TPCDS 1T, 3BE before: 6050 ms after: 6075 ms Issue Number: close #xxx <!--Describe your changes.-->
…agg (#46627) ### What problem does this PR solve? after extracting common expressions for agg, the underlying projection may project redundant columns. for example: original plan Agg(groupkey=[A+B, A+B+1]) --> project(A, B) after extracting, "A+B as C" is detected as a common expression, and the plan becomes Agg(groupKey=[C, C+1]) -->project(A, B, A+B as C) here A, B should not be projected, since they are not used any more. so the optimal plan is Agg(groupKey=[C, C+1]) -->project(A+B as C) Related PR: #40473
…agg (#46627) ### What problem does this PR solve? after extracting common expressions for agg, the underlying projection may project redundant columns. for example: original plan Agg(groupkey=[A+B, A+B+1]) --> project(A, B) after extracting, "A+B as C" is detected as a common expression, and the plan becomes Agg(groupKey=[C, C+1]) -->project(A, B, A+B as C) here A, B should not be projected, since they are not used any more. so the optimal plan is Agg(groupKey=[C, C+1]) -->project(A+B as C) Related PR: #40473
…agg (apache#46627) ### What problem does this PR solve? after extracting common expressions for agg, the underlying projection may project redundant columns. for example: original plan Agg(groupkey=[A+B, A+B+1]) --> project(A, B) after extracting, "A+B as C" is detected as a common expression, and the plan becomes Agg(groupKey=[C, C+1]) -->project(A, B, A+B as C) here A, B should not be projected, since they are not used any more. so the optimal plan is Agg(groupKey=[C, C+1]) -->project(A+B as C) Related PR: apache#40473
Proposed changes
project aggregate function parameters, and then apply common_sub_expression opt by CommonSubExpressionOpt post processor.
example:
agg( sum(A+B), avg(A+B))
+--->Scan(T)
=>
agg(sum(x) , avg(x))
+---> project (A+B as x)
+--->Scan(T)
tpcds 64 changed
TPCDS 1T, 3BE
before: 6050 ms
after: 6075 ms
Issue Number: close #xxx