-
Notifications
You must be signed in to change notification settings - Fork 974
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
Tweak list of optimization rules #3841
Conversation
@@ -163,6 +162,14 @@ impl Optimizer { | |||
rules.push(Arc::new(FilterPushDown::new())); | |||
rules.push(Arc::new(LimitPushDown::new())); | |||
rules.push(Arc::new(SingleDistinctToGroupBy::new())); | |||
rules.push(Arc::new(ProjectionPushDown::new())); |
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.
This one can simply be run after the other 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.
The new plans look a lot nicer to me. The only thing I start to worry about is how long our planning will take -- Perhaps it would be good to add some logging to improve the results.
Maybe related to #1160
@@ -7,12 +7,12 @@ Sort: numwait DESC NULLS FIRST, supplier.s_name ASC NULLS LAST | |||
Inner Join: l1.l_orderkey = orders.o_orderkey | |||
Inner Join: supplier.s_suppkey = l1.l_suppkey | |||
TableScan: supplier projection=[s_suppkey, s_name, s_nationkey] | |||
Filter: l1.l_receiptdate > l1.l_commitdate AND l1.l_receiptdate > l1.l_commitdate | |||
Filter: l1.l_receiptdate > l1.l_commitdate |
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.
👍
Yes, good idea. Also some optimization rules might be improved to e.g. not create filters that already exist etc. But in the end we would also need to keep the passes as simple as possible - a hard balancing act :) |
Benchmark runs are scheduled for baseline = 743ff28 and contender = 431a412. 431a412 is a master commit associated with this PR. Results will be available as each benchmark for each run completes. |
I've just started reviewing this PR and noticed one difference in one of the queries I tested with that might not be optimal. beforeTable scan filter: afterTable scan filter: It looks like we are now performing the CAST twice. |
Actually, I am testing against the latest DF that includes this PR but also has other changes ... so this change could possibly be unrelated to this PR. I will post an update here soon. |
Filed #3863 for this issue. It is not related to this PR after all. |
Which issue does this PR close?
Closes #.
Rationale for this change
I ran all the optimization rules twice and looked at the change in output in the TPC-H regression tests.
Next, I removed all the rules that didn't have any effect, and tried to remove the earlier passes.
What changes are included in this PR?
Are there any user-facing changes?