Note
This view is available starting with V4.0.0.
Purpose
This view displays the metadata of a table group, including the partition information of the table group.
Note
Starting from V4.2.0, the partition attribute fields in this view will be displayed as NONE or NULL.
Columns
| Column |
Type |
Nullable |
Description |
| TABLEGROUP_NAME |
varchar(128) |
NO |
The name of the table group. |
| PARTITIONING_TYPE |
varchar(13) |
NO |
The partition type of the primary partition of the table group. Valid values:
NONE: the table group is not partitioned.
HASH: the table group is HASH-partitioned (single partition key).
KEY: the table group is KEY-partitioned.
RANGE: the table group is RANGE-partitioned (single partition key).
RANGE COLUMNS: the table group is RANGE COLUMNS-partitioned.
LIST: the table group is LIST-partitioned (single partition key).
LIST COLUMNS: the table group is LIST COLUMNS-partitioned.
UNKNOWN: the partition type is invalid.
Note
Starting from V4.2.0, this field is set to NULL.
|
| SUBPARTITIONING_TYPE |
varchar(13) |
NO |
The partition type of the subpartition of the table group. Valid values:
NONE: the table group is not partitioned.
HASH: the table group is HASH-partitioned (single partition key).
KEY: the table group is KEY-partitioned.
RANGE: the table group is RANGE-partitioned (single partition key).
RANGE COLUMNS: the table group is RANGE COLUMNS-partitioned.
LIST: the table group is LIST-partitioned (single partition key).
LIST COLUMNS: the table group is LIST COLUMNS-partitioned.
UNKNOWN: the partition type is invalid.
Note
Starting from V4.2.0, this field is set to NULL.
|
| PARTITION_COUNT |
bigint(20) |
NO |
This field is set to NULL. |
| DEF_SUBPARTITION_COUNT |
bigint(0) |
NO |
This field is set to NULL. |
| PARTITIONING_KEY_COUNT |
bigint(20) |
NO |
This field is set to NULL. |
| SUBPARTITIONING_KEY_COUNT |
bigint(20) |
NO |
This field is set to 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 aggregated on the same server, and no restrictions are imposed on tables added to the table group.
PARTITION: For a table group with this attribute, the 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 aggregated.
ADAPTIVE: For a table group with this attribute, the data of each table in the table group is distributed in an adaptive manner. Specifically, if the tables in the table group are primary-partitioned, the data is distributed across primary partitions. If the tables in the table group are subpartitioned, 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 table group tblgroup1.
obclient [test]> SELECT TABLEGROUP_NAME, SHARDING FROM oceanbase.DBA_OB_TABLEGROUPS WHERE tablegroup_name = 'tblgroup1';
The query result is as follows:
+-----------------+-----------+
| TABLEGROUP_NAME | SHARDING |
+-----------------+-----------+
| tblgroup1 | PARTITION |
+-----------------+-----------+
1 row in set
References
Table groups