Note
This view is available starting with V4.0.0.
Purpose
This view displays the metadata of all table groups of all tenants in the sys tenant. It mainly displays the partitioning information of the table groups.
Note
Starting from V4.2.0, the partitioning attribute fields in this view will be displayed as NONE or NULL.
Columns
| Column |
Type |
Nullable |
Description |
| TENANT_ID |
bigint(20) |
NO |
The tenant ID. |
| TABLEGROUP_NAME |
varchar(128) |
NO |
The name of the table group. |
| PARTITIONING_TYPE |
varchar(13) |
NO |
The partitioning type of the primary partitions of the table group. Valid values:
NONE: indicates a non-partitioned table group.
HASH: indicates a HASH-partitioned table group (single partitioning key).
KEY: indicates a KEY-partitioned table group.
RANGE: indicates a RANGE-partitioned table group (single partitioning key).
RANGE COLUMNS: indicates a RANGE COLUMNS-partitioned table group.
LIST: indicates a LIST-partitioned table group (single partitioning key).
LIST COLUMNS: indicates a LIST COLUMNS-partitioned table group.
UNKNOWN: indicates an abnormal type
Note
Starting from V4.2.0, the value of this field is NULL.
|
| SUBPARTITIONING_TYPE |
varchar(13) |
NO |
The partitioning type of the subpartitions of the table group. Valid values:
NONE: indicates a non-partitioned table group or a table group with primary partitions.
HASH: indicates a HASH-partitioned table group (single partitioning key).
KEY: indicates a KEY-partitioned table group.
RANGE: indicates a RANGE-partitioned table group (single partitioning key).
RANGE COLUMNS: indicates a RANGE COLUMNS-partitioned table group.
LIST: indicates a LIST-partitioned table group (single partitioning key).
LIST COLUMNS: indicates a LIST COLUMNS-partitioned table group.
UNKNOWN: indicates an abnormal type
Note
Starting from V4.2.0, the value of this field is NULL.
|
| PARTITION_COUNT |
bigint(20) |
NO |
The value is NULL. |
| DEF_SUBPARTITION_COUNT |
bigint(0) |
NO |
The value is NULL. |
| PARTITIONING_KEY_COUNT |
bigint(20) |
NO |
The value is NULL. |
| SUBPARTITIONING_KEY_COUNT |
bigint(20) |
NO |
The value is NULL. |
| SHARDING |
varchar(20) |
NO |
The SHARDING attribute of the table group. Valid values:
NONE: For a table group with this attribute, all partitions of all tables in the table group are located on the same server. No table can be added to the table group.
PARTITION: For a table group with this attribute, data of each table in the table group is distributed across primary partitions. For a table group with subpartitions, all subpartitions under each primary partition are located on the same server.
ADAPTIVE: For a table group with this attribute, data of each table in the table group is distributed based on the adaptive method. Specifically, if the table group contains a partitioned table, the data is distributed across primary partitions. If the table group contains a subpartitioned table, the data is distributed across subpartitions under each primary partition.
Note
This field is available starting from V4.2.0.
|
Sample query
Create a table group named tblgroup1.
obclient [test]> CREATE TABLEGROUP tblgroup1 SHARDING = 'PARTITION';
Query the SHARDING attribute of the tblgroup1 table group.
obclient [test]> SELECT TABLEGROUP_NAME, SHARDING FROM oceanbase.CDB_OB_TABLEGROUPS WHERE tablegroup_name = 'tblgroup1';
The query result is as follows:
+-----------------+-----------+
| TABLEGROUP_NAME | SHARDING |
+-----------------+-----------+
| tblgroup1 | PARTITION |
+-----------------+-----------+
1 row in set
References
Table groups