Splitting Index Regions for Tables with Non-Trivial Primary Keys

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

Original topic: 具有非平凡主键的表的拆分索引区域

| username: ljluestc

[TiDB Usage Environment] Production Environment / Testing / Poc
[TiDB Version]
[Reproduction Path] What operations were performed that caused the issue
[Encountered Issue: Problem Phenomenon and Impact]
I read the document (Split Region) [https://pingcap.com/docs-cn/v3.1/sql-statements/sql-statement-split-region/], but I couldn’t find a way to split (or pre-split) the index region of a table with a non-trivial primary key. For example, if there is a table

Create table

CREATE TABLE `t`  (
  `s` varchar(64) NOT NULL PRIMARY KEY,
  `a` int
) ENGINE=InnoDB SHARD_ROW_ID_BITS=2 PRE_SPLIT_REGIONS=2;

It is divided into 4 regions, with 3 regions used to map row id → a

mysql> show table t regions;
+-----------+------------------------------+------------------------------+-----------+-----------------+---------------------+------------+---------------+------------+----------------------+------------------+
| REGION_ID | START_KEY                    | END_KEY                      | LEADER_ID | LEADER_STORE_ID | PEERS               | SCATTERING | WRITTEN_BYTES | READ_BYTES | APPROXIMATE_SIZE(MB) | APPROXIMATE_KEYS |
+-----------+------------------------------+------------------------------+-----------+-----------------+---------------------+------------+---------------+------------+----------------------+------------------+
|     33269 | t_1003_i_1_                  | t_1003_r_2305843009213693952 |     33270 |               9 | 33270, 33271, 33272 |          0 |           293 |          0 |                    1 |                0 |
|     33273 | t_1003_r_2305843009213693952 | t_1003_r_4611686018427387904 |     33274 |               9 | 33274, 33275, 33276 |          0 |             0 |          0 |                    1 |                0 |
|     33277 | t_1003_r_4611686018427387904 | t_1003_r_6917529027641081856 |     33278 |               9 | 33278, 33279, 33280 |          0 |             0 |          0 |                    1 |                0 |
|         2 | t_1003_r_6917529027641081856 |                              |      2437 |               9 | 2437, 22953, 23206  |          0 |             0 |          0 |                    1 |                0 |
+-----------+------------------------------+------------------------------+-----------+-----------------+---------------------+------------+---------------+------------+----------------------+------------------+

Is there any way to split the region mapping primary key s → row id?
[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

No, the algorithm is fixed and is uniformly handled by PD.

| username: redgame | Original post link

What is this scenario?

| username: zhanggame1 | Original post link

The link to your document is not working; version 3.1 is already invalid.

| username: WalterWj | Original post link

The tidb-server process is not running. You can check the log file for more details.

| username: MrSylar | Original post link

Why is non-cluster called a non-trivial primary key table?

| username: zhanggame1 | Original post link

The term “non-trivial primary key table” cannot be found at all…

In database theory, there is a concept called “non-trivial dependency,” but it has no practical use.

| username: MrSylar | Original post link

So when I saw the topic, I was completely puzzled. It must have been a typo.

| username: 有猫万事足 | Original post link

This account often has some replies similar to ChatGPT. No one has restricted it yet.
I boldly speculate that this is an AI trained by the official team. :joy:
It can reply in the forum and also try to ask questions in the forum to collect feedback.

| username: system | Original post link

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