-
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: enhance the rule max_min_eliminate to support multiple agg #12083
Conversation
Codecov Report
@@ Coverage Diff @@
## master #12083 +/- ##
===========================================
Coverage 81.3234% 81.3234%
===========================================
Files 453 453
Lines 97288 97288
===========================================
Hits 79118 79118
Misses 12500 12500
Partials 5670 5670 |
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
Simply move accesspath.idxCols initialization to buildDataSource causes some unexpected problems. I'm working on this. |
@francis0407 You don't need move the codes about |
/rebuild |
1 similar comment
/rebuild |
…_max_min_eli # Conflicts: # planner/core/physical_plan_test.go
A new problem occurred.
We have to clone a new |
…_max_min_eli # Conflicts: # planner/core/rule_max_min_eliminate.go
/run-common-tests |
/run-all-tests |
The issue has been fixed.
The cause is the shallow copy of |
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
Your auto merge job has been accepted, waiting for 12110, 12164 |
/run-all-tests |
What problem does this PR solve?
Fix #12040.
This PR enhances the max_min_elimination rule to support multiple max/min elimination in some circumstance.
Before this PR,
After this PR:
What is changed and how it works?
When there is only a single max/min, we still use the previous method. But when we get multiple max/min aggregations, we should firstly check:
If all of the conditions above are satisfied, we can rewrite such query by a cartesianJoin with several independent aggs. For example:
->
Each single agg will use the previous method to rewrite as Sort + Limit.
Check List
Tests
Side effects