-
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
plan: build anti semi join for NOT EXISTS
#7842
Conversation
/run-all-tests |
/run-all-tests |
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 |
@@ -562,7 +562,7 @@ func (er *expressionRewriter) handleExistSubquery(v *ast.ExistsSubqueryExpr) (as | |||
er.err = errors.Trace(err) | |||
return v, true | |||
} | |||
if len(rows) > 0 { | |||
if (len(rows) > 0 && !v.Not) || (len(rows) == 0 && v.Not) { |
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.
what does this check mean?
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.
rows
is the result of the subquery evaluated by EvalSubquery()
, it directly set the result of exists
subquery according to rows
.
NOT EXISTS
NOT EXISTS
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-mybatis-test |
Parser part of the cherry-pick for pingcap/tidb#7842
Can this really make performance? Is there some test cases or benckmark ? |
What problem does this PR solve?
Fix #7837
What is changed and how it works?
remove
Not UnaryOperationExpr
from AST, and storeNOT
inExistsSubqueryExpr
.After this PR:
Check List
Tests
Side effects
N/A
Related changes
N/A