-
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: prepare AccessPath.PartialAlternativeIndexPaths
to handle MV indexes
#58397
planner: prepare AccessPath.PartialAlternativeIndexPaths
to handle MV indexes
#58397
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #58397 +/- ##
================================================
+ Coverage 73.5280% 73.7163% +0.1883%
================================================
Files 1681 1681
Lines 463868 464194 +326
================================================
+ Hits 341073 342187 +1114
+ Misses 101981 101243 -738
+ Partials 20814 20764 -50
Flags with carried forward coverage won't be shown. Click here to find out more.
|
/retest |
1 similar comment
/retest |
/test unit-test |
@time-and-fate: The specified target(s) for
Use
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
if len(ret[i].usableFilters) <= 0 { | ||
ret[i].usableFilters = []expression.Expression{expr} | ||
} | ||
ret[i].usableFilters = []expression.Expression{expr} |
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 changes here should have been included in the last PR but I missed it.
It turns out we don't need, and also should not differentiate the two cases. Otherwise, the final plan may miss some IndexFilters.
/* For example: | ||
create table t (a int, b int, c int, key a(a), key b(b), key ac(a, c), key bc(b, c)); | ||
explain format='verbose' select * from t where a=1 or b=1 order by c; | ||
For a=1, it has two partial alternative paths: [a, ac] | ||
For b=1, it has two partial alternative paths: [b, bc] | ||
Then we build such a AccessPath: | ||
AccessPath { | ||
PartialAlternativeIndexPaths: [[[a], [ac]], [[b], [bc]]] | ||
IndexMergeORSourceFilter: a = 1 or b = 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.
This is moved from comments of generateIndexMergeOrPaths()
, which will be deleted later.
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.
Thanks!
idxMergeDigest += "," | ||
} | ||
idxMergeDigest += "{" | ||
resultStrs := make([]string, 0, len(paths)-startIndex) |
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 guess we have enough test cases to cover this refactoring. Nice refactoring!
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: AilinKid, Rustin170506 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
[LGTM Timeline notifier]Timeline:
|
What problem does this PR solve?
Issue Number: ref #58361
What changed and how does it work?
AccessPath.PartialAlternativeIndexPaths
is changed from[][]*AccessPath
to[][][]*AccessPath
.cmpAlternativesByRowCount()
is extracted frombuildIntoAccessPath()
to be reused inmatchPropForIndexMergeAlternatives()
.Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.