-
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: variable tidb_opt_enable_hash_join
to skip hash join
#46575
Merged
ti-chi-bot
merged 17 commits into
pingcap:master
from
coderplay:tidb_opt_enable_hash_join
Sep 26, 2023
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
f2a5193
init commit
coderplay a240907
Merge branch 'master' of https://github.com/pingcap/tidb
coderplay e48b565
revert the library importing
coderplay ac6748e
revert the library importing
coderplay b0a6417
merge the master
coderplay 8b3abc5
Address feedbacks
coderplay 061c178
Merge branch 'master' of https://github.com/pingcap/tidb into tidb_op…
coderplay cdf1010
address the issue after merge
coderplay 7543cc8
Merge branch 'master' of https://github.com/pingcap/tidb into tidb_op…
coderplay eb9850a
fix a bug
coderplay cae12dc
Make linter happy
qw4990 cef90b0
fix
qw4990 3bbd2df
fix
qw4990 cdb93a7
fix ci
qw4990 c6dc9b3
fix ci
qw4990 e4dd5d7
fix ci
qw4990 a6893ef
fix ci
qw4990 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Another problem that needs to solve is to avoid
no-plan
error.In the case below, after disabling
Hash Join
, the optimizer can't find a plan for this query.Can we implement this in
LogicalJoin.exhaustPhysicalPlans
where we can know whether there is any other possible join plans?Then to implement it in this way:
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 appears to be the behavior we actually want, doesn't it? If a user explicitly disables hash join and also disable merge join, they should expect such consequences. Why should
tidb_opt_enable_hash_join
compromise here instead ofno_merge_join
? Letting it fail seems to be the more predictable outcome; otherwise, users might not be aware of this implicit behavior, right?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.
OK, then we'd better add this into the user doc later on just like what we've done for hints (https://docs.pingcap.com/tidb/dev/optimizer-hints#using-hints-causes-the-cant-find-a-proper-physical-plan-for-this-query-error).
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 am creating another PR for the doc.
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.
see pingcap/docs#14905