-
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
Feature/index scan limit push down #2823
Feature/index scan limit push down #2823
Conversation
…ula into feature/node-polymorphsim
…ature/index-scan-limit-push-down
please resolve the conflicts. |
…ature/index-scan-limit-push-down
Done. |
I didn't find the keyword LIMIT in lookup_sentence, did you solve it via other way? |
In the compound sentence |
I see. our ideas seem to diverge,let me explain what I think.I'm not sure what I think is right. It's just a discussion.
|
Fixed. |
@critical27 @bright-starry-sky I don't agree with the changes about the Plan Node kind, this new definition is quite ugly. I prefer to meet the needs by enhancing the flexibility of pattern, rather than by modifying the way plan node's kind is defined. |
How to enhance the pattern? |
Try one rule to match multiple patterns |
static Pattern pattern = Pattern::create( | ||
graph::PlanNode::Kind::kLimit, | ||
{Pattern::create(graph::PlanNode::Kind::kProject, | ||
{Pattern::create(graph::PlanNode::Kind::kIndexScan, {}, true)})}); |
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.
here should not be one opt rule, but should be split into two rules: limit <-> project, limit -> indexscan
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.
Why need limit->indexscan?
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.
Push limit down indexscan
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 sentence only generate limit
->project
->indexscan
plan
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.
You should consider the optimization rules from the perspective of the optimizer, not just for this case.
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.
We don't need to match the nonexistent pattern.
I think it's ok. We could refactor when get better way in future. |
What's new advances ? @Shylock-Hg @yixinglu . |
94055ca
I don’t accept refactoring in the future. If don’t want to optimize the pattern this time, then implement a few more similar optimization rules. |
In fact, I'm not sure about refactoring. Match variants at once is reasonable demand in this optimizer. Write multiple almost similar rules is not well. |
Codecov Report
@@ Coverage Diff @@
## master #2823 +/- ##
==========================================
- Coverage 85.47% 84.71% -0.76%
==========================================
Files 1229 1232 +3
Lines 110375 110924 +549
==========================================
- Hits 94341 93974 -367
- Misses 16034 16950 +916
Continue to review full report at Codecov.
|
Reopen in #2966 |
Require #2796
Sub job of #2602