Will data from different tables be in the same Region?

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

Original topic: 不同表数据会不会在一个Region中?

| username: TiDBer_ySLWWMGO

[Test Environment for TiDB]
[TiDB Version] v7.0.0
[Reproduction Path]
[Encountered Issue: Issue Phenomenon and Impact]
[Resource Configuration]
[Attachments: Screenshots/Logs/Monitoring]

We all know that TiKV is a large map, and the key is a combination of table ID and row ID, which is ordered. So logically, this large map is globally partitioned, with one Region being 96M. Normally, data from different tables is very likely to be distributed in the same Region, right?

| username: Kongdom | Original post link

It is possible. When merging regions, the PD scheduling parameter enable-cross-table-merge can be used to control whether regions from different tables are allowed to merge. By default, it is not allowed, so there will be no situation where a single region corresponds to multiple tables. It is only allowed to merge regions across tables when set to true.

| username: cassblanca | Original post link

Regions will automatically split and merge. It is entirely possible for data from different tables to be in one region, provided that the corresponding parameter controls are set correctly.

| username: zhanggame1 | Original post link

enable-cross-table-merge

  • Set whether to enable cross-table merge.
  • Default value: true

The current version of TiDB allows it by default.

| username: Kongdom | Original post link

:joy: The parameters change with the version.

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

If you have a test environment, you can try the above two SQL queries. You can find out which tables are combined in one region.

| username: redgame | Original post link

Yes, data from different tables is very likely to be distributed in the same Region.

| username: system | Original post link

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