-
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: support join elimination rule #8021
Conversation
/run-all-tests |
LGTM |
Will it be better to not store o.cols and o.schemas, |
} | ||
} | ||
if joinKeysContainIndex { | ||
return p.children[1^innerChildIdx] |
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 remove other possible paths in this case?
Please check whether this would be more readable? |
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
joinPlan.JoinType = LeftOuterJoin | ||
resetNotNullFlag(joinPlan.schema, leftPlan.Schema().Len(), joinPlan.schema.Len()) | ||
case ast.RightJoin: | ||
// right outer join need to be checked elimination | ||
b.optFlag = b.optFlag | flagEliminateOuterJoin | ||
joinPlan.JoinType = RightOuterJoin | ||
resetNotNullFlag(joinPlan.schema, 0, leftPlan.Schema().Len()) | ||
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.
In the optimization phase, the semi joins are also considered, I think we should add the optimization flag for these semi joins in here.
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.
and please add some explain tests to cover these optimizations.
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.
After my seriously considering. I think semi-joins can't be eliminated in any case. So I will remove semi-join in the eliminating rule.
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
/run-all-tests |
What problem does this PR solve?
support join elimination rule #7704
What is changed and how it works?
Add a logical optimize rule:
Check List
Tests
Code changes
Side effects