Skip to content

support show table partition regions (#855) - #859

Merged
crazycs520 merged 2 commits into
pingcap:release-4.0from
crazycs520:855-4.0
May 21, 2020
Merged

crazycs520 merged 2 commits into
pingcap:release-4.0from
crazycs520:855-4.0

Conversation

@crazycs520

Copy link
Copy Markdown
Contributor

Signed-off-by: crazycs520 crazycs520@gmail.com

cherry-pick #855

What problem does this PR solve?

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?

Check List

Tests

  • Unit test

Code changes

  • Has exported function/method change

Side effects

  • No

Related changes

  • Need to cherry-pick to the release branch

Signed-off-by: crazycs520 <crazycs520@gmail.com>
@crazycs520
crazycs520 requested a review from a team May 20, 2020 10:18
@ghost
ghost requested review from kennytm and removed request for a team May 20, 2020 10:18

@XuHuaiyu XuHuaiyu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@codecov

codecov Bot commented May 20, 2020 •

Copy link
Copy Markdown

Codecov Report

Merging #859 into release-4.0 will decrease coverage by 0.01%.
The diff coverage is 69.23%.

@@               Coverage Diff               @@
##           release-4.0     #859      +/-   ##
===============================================
- Coverage        78.25%   78.24%   -0.02%     
===============================================
  Files               40       40              
  Lines            14710    14720      +10     
===============================================
+ Hits             11511    11517       +6     
- Misses            2519     2521       +2     
- Partials           680      682       +2     

@crazycs520

Copy link
Copy Markdown
Contributor Author

/run-all-tests tidb=release-4.0

@tiancaiamao

Copy link
Copy Markdown
Contributor

LGTM
Please resolve conflict @crazycs520

@crazycs520
crazycs520 merged commit d2ea5bd into pingcap:release-4.0 May 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants