A table group is an important logical concept in database management, designed to group a set of tables together for easier management and to optimize data storage and query efficiency. By controlling the physical proximity of these tables in storage, table groups create conditions for faster and more efficient data access and processing.
In OceanBase Database V3.x, table groups were designed with a strong focus on partitioning. All tables added to a table group were required to use the same partitioning method as the group itself. While this strict constraint ensured data consistency, it also limited flexibility in table management. Starting with V4.2.0, the definition of table groups has been simplified. Now, a table group only needs to define the SHARDING property, allowing tables with different partitioning methods to be included in the same table group. This change significantly improves the flexibility of table group management.
Categories of table groups based on the SHARDING attribute
Table groups are classified into two categories based on the value of the SHARDING attribute: SHARDING = NONE and SHARDING != NONE.
Table groups with SHARDING = NONE:
- In these table groups, all table data is concentrated on a single machine, and there are no restrictions on the partitioning type of the tables within the group. This design is suitable for scenarios where high data access performance is required, but the scale of the tables is relatively small.
Table groups with SHARDING != NONE:
- In these table groups, data of each table is distributed across multiple servers. To ensure even data distribution, all tables in the table group must have the same partitioning definition, including the partitioning method, number, and values. The system schedules partitions with the same partitioning attributes on the same server to support efficient partition-wise joins.
Subcategories of table groups with SHARDING != NONE
Table groups with SHARDING != NONE are further classified into two types:
Table groups with SHARDING = PARTITION:
In these table groups, data is partitioned at the partition level, and all subpartitions of the same partition are aggregated. The partitioning definitions of all partitions must be the same to allow the coexistence of partitions and subpartitions.
Partition alignment rules: Partitions with the same partition values are aggregated on the same server. This applies to both partitions and subpartitions of the same partition.
Table groups with SHARDING = ADAPTIVE:
Tables in this type of table group are distributed based on the adaptive method. If the table group contains partitioned tables, data is distributed based on the partitions. If the table group contains secondary partitioned tables, data is distributed based on the subpartitions of each partition.
Partitioning requirements and alignment rules: All tables in the table group must be of the same partitioning type, and have the same partitioning definition. Partitions with the same partition values are aggregated on the same server. For subpartitions, both the partition and subpartition values must be the same.
References
For more information about table group attributes, how to create a table group, and how to manage a table group, see the following topics: