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

sql: support new sql to show the distribution for the given table #59681

Open
bufferflies opened this issue Feb 20, 2025 · 0 comments
Open

sql: support new sql to show the distribution for the given table #59681

bufferflies opened this issue Feb 20, 2025 · 0 comments
Labels
type/feature-request Categorizes issue or PR as related to a new feature.

Comments

@bufferflies
Copy link
Contributor

Feature Request

TiDB has provided the sql to show the location of every region. But sometimes users want to detect the hotspot in stores distinct by tikv/tiflash instance.

Is your feature request related to a problem? Please describe:
The DBA can use more complex SQL to show the distribution of every instance such as grouping by the table TIKV_REGION_PEERS and join in TIKV_REGION_STATUS.

Describe the feature you'd like:

TIDB can provide another SQL to show the distribution of special instances, such as:

show table t1 distribution;

+---------+------------+----------------+----------+------------+-------------------+--------------------+-----------------+------------------+
| DB_NAME | TABLE_NAME | PARTITION_NAME | STORE_ID | STORE_TYPE | REGION_LEADER_NUM | REGION_LEADER_BYTE | REGION_PEER_NUM | REGION_PEER_BYTE |
+---------+------------+----------------+----------+------------+-------------------+--------------------+-----------------+------------------+
| db_1    | table_foo  |                | 1        | TiKV       |               315 |        24057934521 |            1087 |      86938746542 |
| db_1    | table_foo  |                | 2        | TiKV       |               324 |        28204839240 |            1104 |      91039476832 |
| db_1    | table_foo  |                | 3        | TiKV       |               319 |        25986274812 |            1091 |      89405367423 |
| db_1    | table_foo  |                | 4        | TiKV       |               503 |        41039587625 |            1101 |      90482317797 |
+---------+------------+----------------+----------+------------+-------------------+--------------------+-----------------+------------------+

Describe alternatives you've considered:

Teachability, Documentation, Adoption, Migration Strategy:

@bufferflies bufferflies added the type/feature-request Categorizes issue or PR as related to a new feature. label Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/feature-request Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

No branches or pull requests

1 participant