-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[Enhancement] support per bucket optimize for colocate aggregate #29252
Conversation
e53b7b7
to
aa8b7f6
Compare
eff10ec
to
9b81928
Compare
bool token = _ctx->token; | ||
if (!token && _ctx->token.compare_exchange_strong(token, true)) { | ||
RETURN_IF_ERROR(_ctx->sink->set_finishing(state)); | ||
_ctx->current_bucket_sink_finished = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should set even if error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't have to set it. we keep _ctx->all_input_finishing = true; in set_finishing is enough
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if there are too many small tables, should we merge several one to comput?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if there are too many small tables, should we merge several one to comput?
ignore it |
0bd5aff
to
4472b99
Compare
4472b99
to
0e4614d
Compare
[FE PR Coverage Check]😍 pass : 89 / 95 (93.68%) file detail
|
...core/src/main/java/com/starrocks/sql/optimizer/rule/tree/PhysicalDistributionAggOptRule.java
Show resolved
Hide resolved
nonKeyGroupBys.remove(column); | ||
} | ||
|
||
if (nonKeyGroupBys.isEmpty()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if sort key is [a,b,c], it seems that group by prefix of [a,b,c] can use sortAgg, other cases can not use sortAgg, for examples group by b, c.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we won't generate this plan (SCAN->GlobalAGG) for group by b, c.
...core/src/main/java/com/starrocks/sql/optimizer/rule/tree/PhysicalDistributionAggOptRule.java
Show resolved
Hide resolved
|
||
// disable optimize depends on physical order | ||
// eg: sortedStreamingAGG/ PerBucketCompute | ||
public void disablePhysicalDistributionOptimize() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This name isn't reasonable, PhysicalDistribution general means shuffle, broadcast, colocate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kangkaisen Any better name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PhysicalProperty?
Merge queue setting changed
Signed-off-by: stdpain <drfeng08@gmail.com>
f1c83ae
to
212a550
Compare
Signed-off-by: stdpain <drfeng08@gmail.com>
pr-regression: 19 |
SonarCloud Quality Gate failed.
|
[FE Incremental Coverage Report]😍 pass : 85 / 95 (89.47%) file detail
|
[BE Incremental Coverage Report]😞 fail : 27 / 286 (09.44%) file detail
|
…rRocks#29252) * [Enhancement] support per bucket optimize for colocate aggregate Signed-off-by: stdpain <drfeng08@gmail.com> * Fix comments Signed-off-by: stdpain <drfeng08@gmail.com> * Rename Signed-off-by: stdpain <drfeng08@gmail.com> --------- Signed-off-by: stdpain <drfeng08@gmail.com>
https://github.com/Mergifyio backport branch-3.1-cs |
✅ Backports have been created
|
) * [Enhancement] support per bucket optimize for colocate aggregate Signed-off-by: stdpain <drfeng08@gmail.com> * Fix comments Signed-off-by: stdpain <drfeng08@gmail.com> * Rename Signed-off-by: stdpain <drfeng08@gmail.com> --------- Signed-off-by: stdpain <drfeng08@gmail.com> (cherry picked from commit 37b2b0c) # Conflicts: # be/src/exec/pipeline/bucket_process_operator.h # be/src/exec/pipeline/operator.h # fe/fe-core/src/main/java/com/starrocks/planner/PlanFragment.java # fe/fe-core/src/main/java/com/starrocks/qe/scheduler/assignment/LocalFragmentAssignmentStrategy.java # fe/fe-core/src/main/java/com/starrocks/sql/plan/PlanFragmentBuilder.java # gensrc/thrift/PlanNodes.thrift
…rRocks#29252) * [Enhancement] support per bucket optimize for colocate aggregate Signed-off-by: stdpain <drfeng08@gmail.com> * Fix comments Signed-off-by: stdpain <drfeng08@gmail.com> * Rename Signed-off-by: stdpain <drfeng08@gmail.com> --------- Signed-off-by: stdpain <drfeng08@gmail.com>
…rRocks#29252) * [Enhancement] support per bucket optimize for colocate aggregate Signed-off-by: stdpain <drfeng08@gmail.com> * Fix comments Signed-off-by: stdpain <drfeng08@gmail.com> * Rename Signed-off-by: stdpain <drfeng08@gmail.com> --------- Signed-off-by: stdpain <drfeng08@gmail.com>
compare to sorted streaming agg.
It looks like there is some room for optimization. I will do it in the future.
What type of PR is this:
Checklist:
Bugfix cherry-pick branch check: