-
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
executor: support IndexMergeReaderExecutor #12305
Conversation
Codecov Report
@@ Coverage Diff @@
## master #12305 +/- ##
===========================================
Coverage ? 80.1134%
===========================================
Files ? 484
Lines ? 121992
Branches ? 0
===========================================
Hits ? 97732
Misses ? 16458
Partials ? 7802 |
@zz-jason I have fixed the comments. However, the unit-test failed and the log is |
@zz-jason, @SunRunAway, @XuHuaiyu, PTAL. |
2 similar comments
@zz-jason, @SunRunAway, @XuHuaiyu, PTAL. |
@zz-jason, @SunRunAway, @XuHuaiyu, PTAL. |
@zz-jason, @XuHuaiyu, @SunRunAway, PTAL. |
1 similar comment
@zz-jason, @XuHuaiyu, @SunRunAway, PTAL. |
/run-unit-test |
@zz-jason, @XuHuaiyu, @SunRunAway, PTAL. |
@XuHuaiyu I add the comments and force executing using IndexMerge path. |
@XuHuaiyu I meet some problems. I am not sure why it fails using testSuit1. |
@eurekaka I do not have a clear idea why using the testSuit1 failed. |
I manually run the test SQL sequence in MySQL client, the case fails also. Looks like there are bugs in code logic. |
@eurekaka last time, the manual test failed because of the setting of startTS. I updated the code. However, the test still failed. |
@eurekaka all pass. Maybe the |
executor/index_merge_reader.go
Outdated
for i := 0; i < len(e.partialPlans); i++ { | ||
_, ok := e.partialPlans[i][0].(*plannercore.PhysicalIndexScan) | ||
if ok { | ||
kvRanges, err := distsql.IndexRangesToKVRanges(e.ctx.GetSessionVars().StmtCtx, getPhysicalTableID(e.table), e.indexes[i].ID, e.ranges[i], e.feedback) |
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.
s/ kvRanges/ ranges
|
||
// Open implements the Executor Open interface | ||
func (e *IndexMergeReaderExecutor) Open(ctx context.Context) error { | ||
kvRangess := make([][]kv.KeyRange, 0, len(e.partialPlans)) |
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.
s/ kvRangess/ kvRanges
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.
Do I need to rename the variables?
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.
Yes, it's a typo.
@zz-jason, @XuHuaiyu, @qw4990, @SunRunAway, PTAL. |
1 similar comment
@zz-jason, @XuHuaiyu, @qw4990, @SunRunAway, PTAL. |
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.
Should we check the enableIndexMerge
before generating an IndexMerge
plan at find_best_task.go:423
?
/run-all-tests |
/run-all-tests |
LGTM |
LGTM |
/run-all-tests |
@hailanwhu merge failed. |
/run-unit-test |
What problem does this PR solve?
In #11245 PR, we generate the PhysicalPlan for
IndexMerge
. In this PR, we add the executor and execution framework forIndexMerge
.What is changed and how it works?
Add new executor,
IndexMergeReaderExecutor
Add execution framework of
IndexMergeReaderExecutor
, most of the code is borrowed fromIndexLookUp
andTableReader
. However, it is difficult to refactor.Check List
Tests
Test will be added after
IndexMerge
hint added.Code changes
Side effects
Release note
-new feature.