Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: 不同表数据会不会在一个Region中?
[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?
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.
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.
enable-cross-table-merge
- Set whether to enable cross-table merge.
- Default value: true
The current version of TiDB allows it by default.
The parameters change with the version.
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.
Yes, data from different tables is very likely to be distributed in the same Region.
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.