-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Stop most copying LogicalPlan and Exprs in ScalarSubqueryToJoin
#10489
Conversation
e7867cf
to
d69b128
Compare
ScalarSubqueryToJoin
ScalarSubqueryToJoin
match plan { | ||
LogicalPlan::Filter(filter) => { | ||
// Optimization: skip the rest of the rule and its copies if |
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.
Note there is a still a bunch of copying in the actual rewrite logic itself below, but I could not figure out a way to remove it easily as there are several paths that return the original (unmodified) plan for unsupported subqueries
I think we would have to split the check for "is rewrite supported" and the "do the rewrite" logic or something
Given this isn't a tall pole in planning, I don't have any more time to spend on this particular rule so I want to call this good enough
} else { | ||
Ok(Transformed::no(expr)) | ||
} | ||
// replace column references with entry in map, if it 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.
Remove some indenting using the api added in #10448, but the logic is the same
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 thanks @alamb for improving the analyzer
Thank you for the review @comphead |
Which issue does this PR close?
Closes #10294
Rationale for this change
Make the optimizer faster by not copying
What changes are included in this PR?
ScalarSubqueryToJoin
when there are no ScalarSubqueriesOptimizerRule::rewrite
APIAre these changes tested?
Existing CI
Are there any user-facing changes?
No (maybe minimal performance improvements)