Skip to content
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,executor: support global index for IndexScan and IndexLookUpReader #19821

Merged
merged 15 commits into from
Sep 24, 2020

Conversation

ldeng-ustc
Copy link
Contributor

@ldeng-ustc ldeng-ustc commented Sep 6, 2020

What problem does this PR solve?

Support global index in IndexScan and IndexLookUpReader

Proposal: #18982

This PR is based on parser #1010.

Related PR: tikv #8603.

What is changed and how it works?

How it Works:

IndexScan for global index is just like IndexScan for non-parition table index, so we just skip buildPartitionTable when index is global.

For supporting double read, add an extra paritionID column when first read. In parition tables, locate a row not only need a handle, but also a partitionID, so we add PartitionHandle, which combine a paritionID and a normal handle. Then, use PartitionHanle to correctly sort and set KvRanges in tableReader. Because meta data of all paritions of a parition table is same, so we can use a single tableReader to read all rows in different partitions we need.

Check List

Tests

  • Unit test

Release note

  • None.

@ldeng-ustc ldeng-ustc requested review from a team as code owners September 6, 2020 17:26
@ldeng-ustc ldeng-ustc requested review from lzmhhh123 and removed request for a team September 6, 2020 17:26
@ti-srebot ti-srebot added the contribution This PR is from a community contributor. label Sep 6, 2020
@github-actions github-actions bot added the sig/execution SIG execution label Sep 6, 2020
@zhouqiang-cl
Copy link
Contributor

/run-check-title

@sre-bot
Copy link
Contributor

sre-bot commented Sep 6, 2020

Please follow PR Title Format:

  • pkg [, pkg2, pkg3]: what's changed

  • *: what's changed

@tiancaiamao tiancaiamao self-requested a review September 7, 2020 13:54
@tiancaiamao tiancaiamao changed the title Support global index in IndexScan and IndexLookUpReader planner,executor: support global index for IndexScan and IndexLookUpReader Sep 8, 2020
@tiancaiamao
Copy link
Contributor

go mod edit -replace github.com/pingcap/parser= github.com/ldeng-ustc/parser@global_index_executor
And you may also need to update mocktikv to fix CI...

@tiancaiamao
Copy link
Contributor

tiancaiamao commented Sep 8, 2020

PTAL @qw4990 @lzmhhh123

@tiancaiamao
Copy link
Contributor

LGTM

@ti-srebot ti-srebot added the status/LGT1 Indicates that a PR has LGTM 1. label Sep 15, 2020
@tiancaiamao
Copy link
Contributor

PTAL @lzmhhh123

@zz-jason zz-jason removed the request for review from a team September 21, 2020 13:02
Copy link
Contributor

@lzmhhh123 lzmhhh123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ti-srebot ti-srebot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Sep 24, 2020
@lzmhhh123
Copy link
Contributor

/merge

@ti-srebot
Copy link
Contributor

Your auto merge job has been accepted, waiting for:

  • 20108
  • 19797

@ti-srebot ti-srebot added the status/can-merge Indicates a PR has been approved by a committer. label Sep 24, 2020
@ti-srebot
Copy link
Contributor

/run-all-tests

@ti-srebot
Copy link
Contributor

@ldeng-ustc merge failed.

@tiancaiamao
Copy link
Contributor

/merge

@ti-srebot
Copy link
Contributor

/run-all-tests

@ti-srebot
Copy link
Contributor

@ldeng-ustc merge failed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
challenge-program contribution This PR is from a community contributor. sig/execution SIG execution status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants