Abnormal r value appears in show table regions

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

Original topic: show table regions出现异常r值

| username: HTAP萌新

When using show table regions, some confusing points appear:

For example, why is the region id not incremental here (there is a 2013 in the middle), and the r value of this row is particularly large:
t_90_r_800000000008e90900 What does this mean in terms of row number?

【TiDB Usage Environment】Production Environment / Testing / Poc
【TiDB Version】
【Reproduction Path】What operations were performed that caused the issue
【Encountered Problem: Problem Phenomenon and Impact】
【Resource Configuration】Go to TiDB Dashboard - Cluster Info - Hosts and take a screenshot of this page
【Attachments: Screenshots/Logs/Monitoring】

| username: xfworld | Original post link

This is not considered an exception…

Take a look at this

| username: Kongdom | Original post link

You can refer to the example below:

SHOW TABLE t1 REGIONS;
+-----------+--------------+--------------+-----------+-----------------+-------+------------+---------------+------------+----------------------+------------------+------------------------+------------------+
| REGION_ID | START_KEY    | END_KEY      | LEADER_ID | LEADER_STORE_ID | PEERS | SCATTERING | WRITTEN_BYTES | READ_BYTES | APPROXIMATE_SIZE(MB) | APPROXIMATE_KEYS | SCHEDULING_CONSTRAINTS | SCHEDULING_STATE |
+-----------+--------------+--------------+-----------+-----------------+-------+------------+---------------+------------+----------------------+------------------+------------------------+------------------+
|        94 | t_75_        | t_75_r_31717 |        95 |               1 | 95    |          0 |             0 |          0 |                  112 |           207465 |                        |                  |
|        96 | t_75_r_31717 | t_75_r_63434 |        97 |               1 | 97    |          0 |             0 |          0 |                   97 |                0 |                        |                  |
|         2 | t_75_r_63434 |              |         3 |               1 | 3     |          0 |     269323514 |   66346110 |                  245 |           162020 |                        |                  |
+-----------+--------------+--------------+-----------+-----------------+-------+------------+---------------+------------+----------------------+------------------+------------------------+------------------+
3 rows in set (0.00 sec)

The values t_75_r_31717 in the START_KEY column and t_75_r_63434 in the END_KEY column indicate that the data with primary keys between 31717 and 63434 is stored in this Region. t_75_ is a prefix indicating that this is a Region of a table (t), and 75 is the internal ID of the table. If the key value pair of START_KEY or END_KEY is empty, it represents negative infinity or positive infinity, respectively.

| username: HTAP萌新 | Original post link

My table’s primary keys are all integers, so I’m puzzled as to why an outlier appears after r.

| username: HTAP萌新 | Original post link

However, r is not continuous, and the primary key of the table itself is ordered.

| username: Kongdom | Original post link

Is there such a primary key value in the table?
I’m not quite sure if this value is the key value or the value of the field.

| username: HTAP萌新 | Original post link

Logically, it should be the value of the key, just like in the example given by the official documentation where it is an integer.