-
Notifications
You must be signed in to change notification settings - Fork 5.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
expression, planner: allow pushdown count distinct when enumerate physical plans #22867
expression, planner: allow pushdown count distinct when enumerate physical plans #22867
Conversation
No release note, Please follow https://github.com/pingcap/community/blob/master/contributors/release-note-checker.md |
/run-check-release-note |
No release note, Please follow https://github.com/pingcap/community/blob/master/contributors/release-note-checker.md |
/run-check-release-note |
1 similar comment
/run-check-release-note |
No release note, Please follow https://github.com/pingcap/community/blob/master/contributors/release-note-checker.md |
/run-check-release-note |
No release note, Please follow https://github.com/pingcap/community/blob/master/contributors/release-note-checker.md |
9dd6010
to
c314ede
Compare
No release note, Please follow https://github.com/pingcap/community/blob/master/contributors/release-note-checker.md |
No release note, Please follow https://github.com/pingcap/community/blob/master/contributors/release-note-checker.md |
/run-check-release-note |
e68fe4e
to
47047c5
Compare
@hanfei1991 please take a look. I'm unsure if we should make changes in PhysicalHashAgg.attach2TaskForMpp in order to only allow Mpp1Phase to go, or others are already rejected by current logic. So far, the planner will choose Mpp1Phase physical plan. Tests will be added later. |
47047c5
to
8464347
Compare
8464347
to
5aab25c
Compare
add a test in planner: select count(distinct **), sum(distinct **) from .... . To prove that the pushdown check really works well |
Signed-off-by: tison <[email protected]>
970658b
to
b834726
Compare
add failing logic as b834726 |
@hanfei1991 @windtalker PTAL |
@fzhedu please take a look. |
// If AllowDistinctAggPushDown is set to true, we should not consider RootTask. | ||
if !la.ctx.GetSessionVars().AllowDistinctAggPushDown { | ||
// TODO: remove after the cost estimation of distinct pushdown is implemented. | ||
if !la.ctx.GetSessionVars().AllowDistinctAggPushDown && !canPushDownToMPP { |
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 change is wrong.
If AllowDistinctAggPushDown is set to false, we should only consider RootTask.
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.
also need a test to ensure this.
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.
IIRC @hanfei1991 stands that we don't share the same config with AllowDistinctAggPushDown
which is introduced by #15500 and focuses on rewrite distinct
in agg into group by
.
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.
Yeah, the "AllowDistinctAggPushDown" doesn't decide whether to push mpp query.
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.
after disscussed with @zanmato1984 and @hanfei1991 , I approve this change, even through it induces some unexpections.
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.
/LGTM
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by writing |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 4b5cd54
|
@tisonkun: Your PR was out of date, I have automatically updated it for you. At the same time I will also trigger all tests for you: /run-all-tests If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
What problem does this PR solve?
Issue Number: related to pingcap/tiflash#1428
co pingcap/tiflash#1457
Problem Summary:
support push down
count distinct
aggregation to tiflash in mpp mode.What is changed and how it works?
see also pingcap/tiflash#1428
What's Changed:
count distinct
HasDistinct
attr.How it Works:
count distinct
with necessary info.Related changes
N/A
Check List
Tests
Side effects
N/A
Release note