-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
*: global index support index_merge
and mem_index_merge
#52971
Conversation
Hi @Defined2014. Thanks for your PR. PRs from untrusted users cannot be marked as trusted with I understand the commands that are listed here. 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/test-infra repository. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #52971 +/- ##
================================================
+ Coverage 72.3804% 74.0324% +1.6520%
================================================
Files 1482 1508 +26
Lines 428743 440608 +11865
================================================
+ Hits 310326 326193 +15867
+ Misses 99117 94208 -4909
- Partials 19300 20207 +907
Flags with carried forward coverage won't be shown. Click here to find out more.
|
index_merge
and mem_index_merge
51a38ce
to
3537e1f
Compare
/retest |
@Defined2014: Cannot trigger testing until a trusted user reviews the PR and leaves an 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/test-infra repository. |
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, with some minor suggestions and questions.
cnt := 1 | ||
hMap.Set(handle, &cnt) | ||
} else { | ||
*(v.(*int))++ |
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 don't know much about this part of the executor, can you help me understand what this means? That only if every memory reader has a match, it should be included if intersect later?
Can it be that a single (reader) handle is found multiple times for the same reader?
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.
That only if every memory reader has a match, it should be included if intersect later?
Yes.
Can it be that a single (reader) handle is found multiple times for the same reader?
No, each handle will only appear once in the same index worker.
/retest |
@Defined2014: Cannot trigger testing until a trusted user reviews the PR and leaves an 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/test-infra repository. |
/hold Awaiting review by planner team and executor team. |
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.
Rest LGTM
pkg/executor/mem_reader.go
Outdated
// [partNum][rangeNum] | ||
var readerKvRanges [][]kv.KeyRange | ||
if m.partitionMode { | ||
if r, ok := reader.(*memIndexReader); ok && r.index.Global { |
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.
seems it's part of range build-related logic, can we move this to buildTableKeyRanges
?
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.
and here we can only start with L1044
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.
Done, PTAL @AilinKid
readerKvRanges = [][]kv.KeyRange{m.indexMergeReader.keyRanges[i]} | ||
} | ||
|
||
for j, kr := range readerKvRanges { |
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 function looks so long, why remove the original encapsulation here?
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.
Because the original loop order is
for each partition {
for each index {
for each range {
....
}
}
do union or intersection
}
Now I changed it to
for each index {
for each partition {
for each range {
....
}
}
}
do union or intersection
The order of loops is same as indexMergeExec
. The reason is for global index which is in partition mode, but it only has one partition. And it's hard to create table ranges by distsql.TableHandlesToKVRanges
function.
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.
Done, I divided this function into two functions
3bf2bc8
to
2258089
Compare
/test pull-mysql-client-test |
/test check-dev2 |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: AilinKid, mjonss 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 |
/unhold |
/retest |
/test mysql-test |
@Defined2014: The specified target(s) for
The following commands are available to trigger optional jobs:
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/test-infra repository. |
/test mysql-test |
What problem does this PR solve?
Issue Number: close #43013
Problem Summary:
What changed and how does it work?
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.