planner: introduce some new hints for MPP plans#38516
planner: introduce some new hints for MPP plans#38516ti-chi-bot merged 19 commits intopingcap:masterfrom
Conversation
|
[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 submitting an approval review. |
| shuffleJoins := p.tryToGetMppHashJoin(prop, false) | ||
| if (p.preferJoinType&preferShuffleJoin) > 0 && len(shuffleJoins) > 0 { // has shuffle_join hints | ||
| return shuffleJoins, true, nil | ||
| } |
There was a problem hiding this comment.
If we have both BCJoin hint and shuffle join hint, it seems we will chose the shuffle join. Is it expected?
There was a problem hiding this comment.
The behavior of using multiple conflict hints together seems undefined. Let's notify our users on docs and any expectation wouldn't be guaranteed here.
| if la.aggHints.preferAggType&preferMPP1PhaseAgg > 0 { | ||
| preferModes = append(preferModes, Mpp1Phase) | ||
| } else if la.aggHints.preferAggType&preferMPP2PhaseAgg > 0 { | ||
| preferModes = append(preferModes, Mpp2Phase) | ||
| } else if la.aggHints.preferAggType&preferMPPTiDBAgg > 0 { | ||
| preferModes = append(preferModes, MppTiDB) | ||
| } else if la.aggHints.preferAggType&preferMPPScalarAgg > 0 { | ||
| preferModes = append(preferModes, MppScalar) | ||
| } |
There was a problem hiding this comment.
If there are more one mpp aggregation hints. We can only use one?
Change this part to
if .. {}
if .. {}
if .. {}
if .. {}
There was a problem hiding this comment.
Good Catch. But on second thought, it seems that the behavior of using multiple agg-hints together is undefined, so I finally update this part to preferMode instead of preferModes.
|
/run-build |
|
/merge |
|
This pull request has been accepted and is ready to merge. DetailsCommit hash: bd8af96 |
| return bcastJoins, true, nil | ||
| } | ||
| joins = append(joins, bcastJoins...) | ||
| joins = append(joins, shuffleJoins...) |
There was a problem hiding this comment.
If there is no hint and p.shouldUseMPPBCJ is false, the old code only adds shuffleJoins but the new code adds both bcastJoins and shuffleJoins. Is that an expected change?
|
/run-build |
|
/merge |
|
This pull request has been accepted and is ready to merge. DetailsCommit hash: e7268f9 |
|
/merge |
|
This pull request has been accepted and is ready to merge. DetailsCommit hash: cc9a3c3 |
|
/rebuild |
|
/run-build |
TiDB MergeCI notify🔴 Bad News! [2] CI still failing after this pr merged.
|
What problem does this PR solve?
Issue Number: close #xxx
Problem Summary: planner: introduce some new hints for MPP plans
What is changed and how it works?
Introduce some new hints for MPP plans: mpp_1phase_agg(), mpp_2phase_agg(), mpp_tidb_agg(), mpp_scalar_agg(), shuffle_join().
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.