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 <wander4096@gmail.com>
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.
this change is wrong.
If AllowDistinctAggPushDown is set to false, we should only consider RootTask.
There was a problem hiding this comment.
also need a test to ensure this.
There was a problem hiding this comment.
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.
Yeah, the "AllowDistinctAggPushDown" doesn't decide whether to push mpp query.
There was a problem hiding this comment.
after disscussed with @zanmato1984 and @hanfei1991 , I approve this change, even through it induces some unexpections.
|
[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. DetailsReviewer can indicate their review by writing |
|
/merge |
|
This pull request has been accepted and is ready to merge. DetailsCommit 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. DetailsInstructions 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 distinctaggregation to tiflash in mpp mode.What is changed and how it works?
see also pingcap/tiflash#1428
What's Changed:
count distinctHasDistinctattr.How it Works:
count distinctwith necessary info.Related changes
N/A
Check List
Tests
Side effects
N/A
Release note