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
[CALCITE-3916] Implement top-down rule applying and upper bound space pruning #1950
Conversation
CheckInput(OptimizeInputs context, | ||
RelNode parent, CascadeRelSubset input, int i, RelOptCost upper) { | ||
this.context = context; | ||
this.parent = parent; |
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.
Is there any test for it?
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.
Not yet. Will add more.
|
||
/** | ||
* An enum representing optimizing state of current RelSubset | ||
*/ |
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's the difference between CascadeRelSubset
and RelSubset
?
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.
CascadeRelSubset have two more fields: optimizeState and upperBound. The comments in this class will help you understand what they are used for.
hi, @FatLittle Thank you very much for the PR you submitted. Can you include the issue link in the description of this PR? |
@XuQianJin-Stars I think this is the most related JIRA: |
That's it. Thanks, Haisheng! |
1126e7b
to
4d6e477
Compare
protected boolean cascade() { | ||
return false; | ||
} | ||
|
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.
x
pruning in calcite
pruning in calcite: add more tests and resolve some comments
9cfa69e
to
54cde8d
Compare
pruning in calcite: fix case failure
added a commit. Propagate Traits with Haisheng's trait propagation frameworks. Remove AC dependencies. |
* CascadePlanner that apply memo pruning logic` | ||
* based on the data structure of VolcanoPlanner | ||
*/ | ||
public class CascadePlanner extends VolcanoPlanner { |
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.
I think the new planner's name should be CascadesPlanner not CascadePlanner according to the paper "The Cascades Framework for Query Optimization", and we can also find “Cascades” in the Columbia planner source code.
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.
+1
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.
I have modified the names in my new PR: #1991
} | ||
|
||
RelOptCost lowerBound = null; | ||
for (RelNode relNode : subset.getRels()) { |
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.
If current group is not fully optimized and has no winner, there may be problems to get the lower bound here. Since the current group's optimization may affact the input groups of the current group. E.g., the current group's optimization may push down some require traits and maybe somewhere of the inputs subtrees may enhance there's costs. So if we get the lower bound here, it may be larger than the actual lower bound which may miss optimal plan
This PR is superseded by #1991. |
Link to https://issues.apache.org/jira/browse/CALCITE-3916