-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
planner: enforce projection push down #25450
Conversation
74861b8
to
b61feb1
Compare
@@ -380,7 +380,7 @@ func (s *tiflashTestSuite) TestTiFlashPartitionTableReader(c *C) { | |||
|
|||
tk.MustExec("SET tidb_enforce_mpp=1") | |||
tk.MustExec("set @@session.tidb_isolation_read_engines='tiflash'") | |||
for i := 0; i < 100; i++ { | |||
for i := 0; i < 10; i++ { |
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.
before this PR, this test do not run in MPP. after this PR, this test timeout, so reduce the running times.
/run-all-tests |
return []PhysicalPlan{proj}, true, nil | ||
newProps := []*property.PhysicalProperty{newProp} | ||
// generate a mpp task candidate if enforced mpp | ||
if newProp.TaskTp != property.MppTaskType && p.SCtx().GetSessionVars().IsMPPEnforced() { |
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.
better to check "canPushDownToCop(TiFlash)"
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.
It can avoid some plan id changes
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.
done, by the way, should we consider whether expressions can push down?
207787e
to
c287b6d
Compare
"explain format='verbose' select count(*) from t where a=1", | ||
"explain format='verbose' select /*+ read_from_storage(tikv[t]) */ count(*) from t where a=1", | ||
"explain format='verbose' select /*+ read_from_storage(tiflash[t]) */ count(*) from t where a=1", | ||
"explain format = 'brief' select count(*) from t where a=1", |
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.
@LittleFall can I change this? because it binds the id of each operator, which will be changed in future due to other PRs.
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.
I set format='verbose'
to check that the task cost is reduced by enforce_mpp
. So I suggest keeping verbose
in the test suite TestEnforceMPP
, and use format='brief'
to check other tests.
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
"explain format='verbose' select count(*) from t where a=1", | ||
"explain format='verbose' select /*+ read_from_storage(tikv[t]) */ count(*) from t where a=1", | ||
"explain format='verbose' select /*+ read_from_storage(tiflash[t]) */ count(*) from t where a=1", | ||
"explain format = 'brief' select count(*) from t where a=1", |
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.
I set format='verbose'
to check that the task cost is reduced by enforce_mpp
. So I suggest keeping verbose
in the test suite TestEnforceMPP
, and use format='brief'
to check other tests.
@LittleFall: Thanks for your review. The bot only counts approvals from reviewers and higher roles in list, but you're still welcome to leave your comments. In response to this:
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. |
return []PhysicalPlan{proj}, true, nil | ||
newProps := []*property.PhysicalProperty{newProp} | ||
// generate a mpp task candidate if enforced mpp | ||
if newProp.TaskTp != property.MppTaskType && p.SCtx().GetSessionVars().IsMPPEnforced() && p.canPushToCop(kv.TiFlash) && |
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.
It's a very hack code here. Can we find the root cause why properties don't contain MppTaskType
? These generated plans are dangerous with force MPP type.
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 projection is the top operator, we should add a option of MPPTaskType. it is not dangenous, because in the physical phase, if it cannot satisfy MPPTaskType, it only generates root tasks.
[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 submitting an approval review. |
/run-all-tests |
/run-check_dev_2 |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 3dbd838
|
/run-check_dev_2 |
Signed-off-by: ti-srebot <[email protected]>
cherry pick to release-5.0 in PR #25740 |
Signed-off-by: ti-srebot <[email protected]>
cherry pick to release-5.1 in PR #25741 |
What problem does this PR solve?
Issue Number: close #xxx
Problem Summary: if enforced MPP, we push down projection to tiflash.
What is changed and how it works?
Proposal: xxx
What's Changed:
How it Works:
Related changes
Check List
Tests
Release note