Can the regions of a table in TiDB be manually merged?

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

Original topic: TiDB中表的region可以手工merge么

| username: 数据源的TiDB学习之路

[TiDB Usage Environment] Production Environment / Testing / PoC
[TiDB Version] 7.1
[Reproduction Path] There are only 100,000 rows of data in the table in TiDB, but there are dozens of regions. Can manual merge operations be performed?
[Encountered Problem: Problem Phenomenon and Impact]
[Resource Configuration]
[Attachment: Screenshot/Log/Monitoring]

| username: TiDBer_jYQINSnf | Original post link

You can manually merge.
Region sibling 2 refers to the adjacent region of region 2.
Then, operator add merge-operator 2 x means merging region 2 into x, where x is the adjacent region.

| username: tidb菜鸟一只 | Original post link

Executing operator add merge-region 1 2 in pdctl manually merges regions 1 and 2.

| username: TiDBer_QYr0vohO | Original post link

operator add merge-operator 1 2

| username: dba远航 | Original post link

You can manually merge, but it feels that merging is not as fast as exporting and then importing, and it’s easier to operate. Alternatively, you can use CTAS to create a new table and then rename it.

| username: yulei7633 | Original post link

It can be merged, but in this case, it’s best to let PD handle the automatic merge.

| username: zhanggame1 | Original post link

It doesn’t make much sense; it still needs to be compacted.

| username: system | Original post link

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