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

executor: support show table partition regions #17229

Merged
merged 14 commits into from
May 19, 2020

Conversation

crazycs520
Copy link
Contributor

Signed-off-by: crazycs520 [email protected]

What problem does this PR solve?

related parser PR pingcap/parser#855

As the title said, here is an example:

mysql>show table t partition (p4) regions;
+-----------+----------------+----------------+-----------+-----------------+-------+------------+---------------+------------+----------------------+------------------+
| REGION_ID | START_KEY      | END_KEY        | LEADER_ID | LEADER_STORE_ID | PEERS | SCATTERING | WRITTEN_BYTES | READ_BYTES | APPROXIMATE_SIZE(MB) | APPROXIMATE_KEYS |
+-----------+----------------+----------------+-----------+-----------------+-------+------------+---------------+------------+----------------------+------------------+
| 1047      | t_154_r        | t_154_r_200000 | 1048      | 1               | 1048  | 0          | 0             | 0          | 1                    | 1                |
| 1049      | t_154_r_200000 | t_154_r_400000 | 1050      | 1               | 1050  | 0          | 0             | 0          | 1                    | 0                |
| 1051      | t_154_r_400000 | t_154_r_600000 | 1052      | 1               | 1052  | 0          | 0             | 0          | 1                    | 0                |
| 1053      | t_154_r_600000 | t_154_r_800000 | 1054      | 1               | 1054  | 0          | 0             | 0          | 1                    | 0                |
| 2         | t_154_r_800000 |                | 3         | 1               | 3     | 0          | 747           | 0          | 1                    | 0                |
| 1045      | t_154_         | t_154_r        | 1046      | 1               | 1046  | 0          | 0             | 0          | 1                    | 1                |
+-----------+----------------+----------------+-----------+-----------------+-------+------------+---------------+------------+----------------------+------------------+
6 rows in set
Time: 0.009s
mysql>show table t partition (p3) regions;
+-----------+-----------+---------+-----------+-----------------+-------+------------+---------------+------------+----------------------+------------------+
| REGION_ID | START_KEY | END_KEY | LEADER_ID | LEADER_STORE_ID | PEERS | SCATTERING | WRITTEN_BYTES | READ_BYTES | APPROXIMATE_SIZE(MB) | APPROXIMATE_KEYS |
+-----------+-----------+---------+-----------+-----------------+-------+------------+---------------+------------+----------------------+------------------+
| 1041      | t_153_    | t_154_  | 1042      | 1               | 1042  | 0          | 0             | 0          | 1                    | 0                |
+-----------+-----------+---------+-----------+-----------------+-------+------------+---------------+------------+----------------------+------------------+
1 row in set

What is changed and how it works?

Related changes

  • Need to cherry-pick to the release branch

Check List

Tests

  • Unit test

Side effects

Release note

  • support show table partition regions.

@crazycs520 crazycs520 requested a review from a team as a code owner May 15, 2020 04:15
@ghost ghost requested review from wshwsh12 and removed request for a team May 15, 2020 04:15
Copy link
Contributor

@tangenta tangenta left a comment

Choose a reason for hiding this comment

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

LGTM

@tangenta tangenta added the status/LGT1 Indicates that a PR has LGTM 1. label May 15, 2020
@crazycs520
Copy link
Contributor Author

/run-all-tests

@crazycs520
Copy link
Contributor Author

/run-all-tests

Copy link
Contributor

@djshow832 djshow832 left a comment

Choose a reason for hiding this comment

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

LGTM

@tiancaiamao
Copy link
Contributor

LGTM

@tiancaiamao tiancaiamao added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels May 18, 2020
tiancaiamao
tiancaiamao previously approved these changes May 18, 2020
@tiancaiamao
Copy link
Contributor

/merge

@sre-bot sre-bot added the status/can-merge Indicates a PR has been approved by a committer. label May 18, 2020
@sre-bot
Copy link
Contributor

sre-bot commented May 18, 2020

/run-all-tests

@sre-bot
Copy link
Contributor

sre-bot commented May 18, 2020

@crazycs520 merge failed.

@codecov
Copy link

codecov bot commented May 19, 2020

Codecov Report

Merging #17229 into master will not change coverage.
The diff coverage is n/a.

@@             Coverage Diff             @@
##             master     #17229   +/-   ##
===========================================
  Coverage   79.8557%   79.8557%           
===========================================
  Files           517        517           
  Lines        139881     139881           
===========================================
  Hits         111703     111703           
  Misses        19209      19209           
  Partials       8969       8969           

@crazycs520 crazycs520 merged commit 1982be5 into pingcap:master May 19, 2020
@crazycs520
Copy link
Contributor Author

/run-cherry-picker

sre-bot pushed a commit to sre-bot/tidb that referenced this pull request May 19, 2020
@sre-bot
Copy link
Contributor

sre-bot commented May 19, 2020

cherry pick to release-4.0 in PR #17294

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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. type/usability
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants