Note
This view was introduced in OceanBase Database V4.0.0.
Purpose
The oceanbase.CDB_OB_TABLEGROUPS view displays the metadata of table groups of all tenants in the sys tenant, especially the partition information of the table groups.
Note
The partitioning attribute column in this view is meaningless in OceanBase Database V4.2.0 and later and its value is NONE or NULL by default.
Columns
| Column | Type | Nullable? | Description |
|---|---|---|---|
| TENANT_ID | bigint(20) | NO | The ID of the tenant. |
| TABLEGROUP_NAME | varchar(128) | NO | The name of the table group. |
| PARTITIONING_TYPE | varchar(13) | NO | The partitioning type of the partitioned table group. Valid values: NONE: indicates non-partitioning.HASH: indicates HASH partitioning (with a single partitioning key).KEY: indicates KEY partitioning.RANGE: indicates RANGE partitioning (with a single partitioning key).RANGE COLUMNS: indicates RANGE COLUMNS partitioning.LIST: indicates LIST partitioning (with a single partitioning key).LIST COLUMNS: indicates LIST COLUMNS partitioning.UNKNOWN: indicates an unknown type.
NoteIn OceanBase Database V4.2.0 and later, the value of this column is |
| PARTITIONING_TYPE | varchar(13) | NO | The partitioning type of the partitioned table group. Valid values: NONE: indicates non-partitioning.HASH: indicates HASH partitioning (with a single partitioning key).KEY: indicates KEY partitioning.RANGE: indicates RANGE partitioning (with a single partitioning key).RANGE COLUMNS: indicates RANGE COLUMNS partitioning.LIST: indicates LIST partitioning (with a single partitioning key).LIST COLUMNS: indicates LIST COLUMNS partitioning.UNKNOWN: indicates an unknown type.
NoteIn OceanBase Database V4.2.0 and later, the value of this column is |
| SUBPARTITIONING_TYPE | varchar(13) | NO | The subpartitioning type of the partitioned table group. Valid values: NONE: indicates non-subpartitioning.HASH: indicates HASH partitioning (with a single partitioning key).KEY: indicates KEY partitioning.RANGE: indicates RANGE partitioning (with a single partitioning key).RANGE COLUMNS: indicates RANGE COLUMNS partitioning.LIST: indicates LIST partitioning (with a single partitioning key).LIST COLUMNS: indicates LIST COLUMNS partitioning.UNKNOWN: indicates an unknown type.
NoteIn OceanBase Database V4.2.0 and later, the value of this column is |
| PARTITION_COUNT | bigint(20) | NO | The number of partitions in the partitioned table group. For a non-partitioned table group, the value is NULL. |
| DEF_SUBPARTITION_COUNT | bigint(0) | NO | The number of subpartitions in the partitioned table group. For a non-subpartitioned table group, the value is NULL. |
| PARTITIONING_KEY_COUNT | bigint(20) | NO | The number of partitioning keys for the partitioned table group. For a non-partitioned table group, the value is NULL. |
| SUBPARTITIONING_KEY_COUNT | bigint(20) | NO | The number of subpartitioning keys for the partitioned table group. For a non-subpartitioned table group, the value is NULL. |
| SHARDING | varchar(10) | NO | The SHARDING attribute of the table group. Valid values:
NoteThis column is available in OceanBase Database V4.2.0 and later. |
Sample query
Create a table group named
tblgroup1.obclient [test]> CREATE TABLEGROUP tblgroup1 SHARDING = 'PARTITION';Query the
SHARDINGattribute of thetblgroup1table 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