Can regions be shared across multiple tables?

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

Original topic: region可以在多个表共享吗

| username: chenhanneu

[TiDB Usage Environment] Production Environment / Testing / PoC
[TiDB Version]
[Reproduction Path] What operations were performed when the issue occurred
[Encountered Issue: Issue Phenomenon and Impact]
Can a region contain data from multiple tables?
[Resource Configuration] Go to TiDB Dashboard - Cluster Info - Hosts and take a screenshot of this page
[Attachments: Screenshots/Logs/Monitoring]

| username: 大飞哥online | Original post link

A Region can only belong to one table. The data of each table is stored and managed in the TiKV cluster in the form of Regions. Region is the basic unit for data distribution and load balancing in TiKV.

| username: 大飞哥online | Original post link

When creating a table, TiDB divides the table’s data into multiple Regions based on the table’s partitioning rules and distributes these Regions across different nodes in the TiKV cluster. Each Region stores a portion of the table’s data.

Therefore, a Region will only contain data from one table and will not simultaneously contain data from multiple tables. Each table will have its own set of Regions to store its data.

| username: dba-kit | Original post link

Actually, it is possible. After enabling enable-cross-table-merge, region merge between tables is supported.

| username: Fly-bird | Original post link

Enable cross-table merge

| username: zhanggame1 | Original post link

In the current version, when a new table is created, the regions of this table are definitely from the same table. Over time, it is possible for data from multiple tables to automatically move to 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.