Note
This view is available starting with V4.0.0.
Overview
The system tenant displays the meta information of table groups for all tenants, primarily showing the partition information of the table groups.
Note
Starting from V4.2.0, the partition attribute fields in this view will no longer be meaningful and are uniformly displayed as NONE or NULL.
Columns
Field Name |
Type |
Whether can be NULL |
Description |
|---|---|---|---|
| TENANT_ID | bigint(20) | NO | Tenant ID |
| TABLEGROUP_NAME | varchar(128) | NO | Table group name |
| PARTITIONING_TYPE | varchar(13) | NO | Partition type of a partitioned table group's partition:
NoteStarting from V4.2.0, the value of this field is |
| SUBPARTITIONING_TYPE | varchar(13) | NO | Partition type of a subpartition in a partitioned table group:
NoteThis field is |
| PARTITION_COUNT | bigint(20) | NO | The number of partitions in a partitioned table group. For a non-partitioned table group, this value isNULL |
| DEF_SUBPARTITION_COUNT | bigint(0) | NO | The number of partitions in the subpartition template of a partitioned table group. For a table group without a defined subpartition template, this value isNULL |
| PARTITIONING_KEY_COUNT | bigint(20) | NO | The number of partitioning keys for a partitioned table group. For a non-partitioned table group, this value isNULL |
| SUBPARTITIONING_KEY_COUNT | bigint(20) | NO | The number of partitioning keys for a subpartitioned table group. For a non-subpartitioned table group, this value isNULL |
| SHARDING | varchar(10) | NO | The SHARDING attribute of the table group. Valid values:
NoteThis field is available starting with V4.2.0. |
Sample query
Create a table group named
tblgroup1.obclient [test]> CREATE TABLEGROUP tblgroup1 SHARDING = 'PARTITION';Check the SHARDING attribute of the table group
tblgroup1.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
