-
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/core: make join reorder by dp work #8816
Conversation
The impact on TPCH has not been validated. |
/run-all-tests |
fe5ad2a
to
841945e
Compare
841945e
to
868a44d
Compare
/run-all-tests |
/run-all-tests |
cba29b9
to
dd7cd1a
Compare
sessionctx/variable/session.go
Outdated
@@ -690,6 +695,8 @@ func (s *SessionVars) SetSystemVar(name string, val string) error { | |||
s.EnableRadixJoin = TiDBOptOn(val) | |||
case TiDBEnableWindowFunction: | |||
s.EnableWindowFunction = TiDBOptOn(val) | |||
case TiDBOptJoinOrderAlgoThreshold: | |||
s.TiDBOptJoinOrderAlgoThreshold = tidbOptPositiveInt32(val, DefTiDBOptJoinOrderAlgoThreshold) |
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.
Should we also limit its upper bound?
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 think the set it too large
can be treated as that we want every join order calculated by dp.
Though it not reasonable in a real environment, i think it's reasonable in logic...
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 it is larger than 64, will the DP algorithm panic?
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.
Changed.
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, please resolve conflicts.
@winoros Any updates? |
Disable by default. |
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
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
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
What problem does this PR solve?
Make the algo that use dp to do the join reorder integrated with the current planner.
What is changed and how it works?
The original algo only considers equal conditions. This time we add support for
OhterConds
.And when the join node is no greater than 10, we'll choose it. Otherwise, we'll use the greedy one.
Check List
Tests
Code changes
Side effects
Related changes
This change is