Disk size is 1.9T but there are nearly 90,000 region leaders and a total of 270,000 regions

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: 磁盘大小1.9T但是region leader高达将近9万个,region总数27万个

| username: TiDBer_SHQw04Jz

[TiDB Usage Environment] Production Environment / Testing / PCO
Production Environment
[TiDB Version]
5.1.X
[Encountered Issues]
The disk size is 1.9T, but the number of region leaders is nearly 90,000, and the total number of regions is 270,000.
There are no empty regions, and silent regions are enabled.
This may be causing pressure on the raft store. How can this issue be investigated? Why are there so many regions?
On this cluster, the execution time of the same SQL with limit 10 and limit 1000 differs by more than 5 times, even though the execution plans are identical. Why is there such a large difference?

[Reproduction Path] What operations were performed to encounter the issue
[Issue Phenomenon and Impact]

[Attachments]

Please provide the version information of each component, such as cdc/tikv, which can be obtained by executing cdc version/tikv-server --version.

| username: 张雨齐0720 | Original post link

Is there a way to modify the default region size?

| username: Kongdom | Original post link

A region is a left-closed, right-open interval, with a size that is not fixed and not necessarily continuous. I don’t understand what you mean by “too many in number.”

| username: xfworld | Original post link

Could you please provide detailed information about the cluster configuration?

Also, upload the Prometheus graphs related to region monitoring.

| username: alfred | Original post link

Is it possible to check the distribution of region sizes?

| username: wisdom | Original post link

Please provide the Prometheus region monitoring graph.

| username: h5n1 | Original post link

  1. Check the monitoring
    TiKV-Trouble-Shooting → Huge Region → Approximate Region size

  2. The difference in execution time may be related to the number of MVCC versions. Use explain analyze to check the differences in processed_keys and total_processed_keys in the execution plans of the two SQL queries.

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.