-
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
planner: Mpp outer join build side (#25130) #25142
planner: Mpp outer join build side (#25130) #25142
Conversation
Signed-off-by: ti-srebot <[email protected]>
/run-all-tests |
@windtalker you're already a collaborator in bot's repo. |
This reverts commit 7d777df.
…lease-5.0-c59b3bcea6ef
Cherry-pick #25240 into this pr. |
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.
add more cases?
@@ -129,6 +132,9 @@ func (s *tiflashTestSuite) TestReadUnsigedPK(c *C) { | |||
tk.MustExec("set @@session.tidb_isolation_read_engines=\"tiflash\"") | |||
tk.MustExec("set @@session.tidb_allow_mpp=ON") |
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.
enforce_mpp?
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.
enforce_mpp
is not supported in release-5.0
if useBCJ || p.ctx.GetSessionVars().MPPOuterJoinFixedBuildSide || len(p.OtherConditions) > 0 { | ||
if p.JoinType == LeftOuterJoin { | ||
preferredBuildIndex = 1 | ||
} | ||
} else if p.children[0].statsInfo().Count() > p.children[1].statsInfo().Count() { | ||
preferredBuildIndex = 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.
does tests cover these cases?
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.
Yes
@@ -38,6 +38,27 @@ | |||
"explain format = 'brief' select count(*) from fact_t where d1_k not in (select d1_k from d1_t)" | |||
] | |||
}, | |||
{ | |||
"name": "TestMPPOuterJoinBuildSideForBroadcastJoin", | |||
"cases": [ |
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.
add more case for other conditions, cross join?
also need randgen tests to guarantee rightness.
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 the outer join has other condition, it will always use inner table as the build side, this behavior is not changed by this pr. For cross join, TiFlash will convert Cross right join
to Cross left join
, so is not affected by this pr.
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
@fzhedu: Please use GitHub review feature instead of For the reason we drop support to the commands, see also this page. 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. |
[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. |
/merge |
@windtalker: 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. |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 0d88cc6
|
/run-all-tests |
cherry-pick #25130 to release-5.0
You can switch your code base to this Pull Request by using git-extras:
# In tidb repo: git pr https://github.com/pingcap/tidb/pull/25142
After apply modifications, you can push your change to this PR via:
What problem does this PR solve?
Issue Number: close #xxx
Problem Summary:
In MPP outer join, it always use the inner table as the build table, however, TiFlash actually support use outer table as the build table in outer join, so we can enable this to speed up query.
What is changed and how it works?
Proposal: xxx
What's Changed:
How it Works:
for mpp outer join, choose the build table based on the row count.
Related changes
pingcap/docs
/pingcap/docs-cn
:Check List
Tests
Side effects
Release note