-
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: mark the both side operand of NAAJ & refuse partial column substitute in projection elimination of Apply de-correlation (#37117) #37354
planner: mark the both side operand of NAAJ & refuse partial column substitute in projection elimination of Apply de-correlation (#37117) #37354
Conversation
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
[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. |
/run-all-tests |
@AilinKid you're already a collaborator in bot's repo. |
Code Coverage Details: https://codecov.io/github/pingcap/tidb/commit/ab51c867a9b977b72e35bf3787d39488d0bc59a8 |
/run-unit-test |
/test unit-test |
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
@elsa0520: Thanks for your review. The bot only counts approvals from reviewers and higher roles in list, but you're still welcome to leave your comments. 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: 9446fc3
|
cherry-pick #37117 to release-6.1
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/37354
After apply modifications, you can push your change to this PR via:
Signed-off-by: AilinKid 314806019@qq.com
What problem does this PR solve?
Issue Number: close #37032
Problem Summary:
two problems mainly:
1: in the projection elimination of Apply decorrelate rule, we try to substitute any condition used in Apply with raw projected expression under this projection, after which this projection can be eliminated. But we should make sure
that all columns mapped from the schema of projection OP must be substituted atomically (all succeed or fail).
2: Consider an EQ condition converted from NOT IN OP (NAAJ), in which we used to mark the right side column of this "NA" EQ as InOperand=true. In some cases like columns substitution as we talked about above, cases like:
(a NA EQ b (marked InOperand=true ) ) where b will be substituted with like a constant string, so we got (a NA EQ "example" ), this condition will not be considered as a NA EQ condition anymore and will be moved from other condition to equal condition of join OP in the logical rule of pddResolver .
What is changed and how it works?
1: NAAJ is not just about one side, mark both as inOperand=true. so even the right has successfully been substituted with a constant string, we can also get (a (marked InOperand=true) NA EQ "example" ) as a NA EQ in the other condition.
2: make the column substitution atomically (all succeed or fail) in projection elimination of Apply decorrelation.
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.