Note
For V4.2.5, this view is available starting with V4.2.5 BP2.
Overview
The CDB_OB_OBJECT_BALANCE_WEIGHT view displays all partitions with special weights set under all user tenants.
Columns
Field Name |
Type |
Whether can be NULL |
Description |
|---|---|---|---|
| TENANT_ID | bigint(20) | NO | Tenant ID |
| TABLE_ID | bigint(20) | NO | Table ID |
| PARTITION_ID | bigint(20) | NO | The ID of the partition. When no partition weight is set, the value isNULL |
| SUBPARTITION_ID | bigint(20) | NO | Subpartition ID. When partition weight is not set, the value isNULL, setting subpartition weights is currently not supported. |
| WEIGHT | bigint(20) | NO | Partition Weight |
| DATABASE_NAME | varchar(128) | NO | The name of the database to which the table belongs. |
| TABLE_NAME | varchar(256) | NO | Table name |
| PARTITION_NAME | varchar(64) | NO | Partition name |
| SUBPARTITION_NAME | varchar(64) | NO | Subpartition name |
| TABLEGROUP_NAME | varchar(128) | NO | Table group name |
| DATABASE_ID | bigint(20) | NO | The ID of the database to which the table belongs. |
| TABLEGROUP_ID | bigint(20) | NO | Table group ID |
| OBJECT_ID | bigint(20) | NO | Object ID of the table |
Sample query
Query partitions with special weights set under user tenant with ID 1002 in the system tenant.
obclient[oceanbase]> SELECT * FROM oceanbase.CDB_OB_OBJECT_BALANCE_WEIGHT WHERE TENANT_ID = 1002;
The query result is as follows:
+-----------+----------+--------------+-----------------+--------+---------------+------------+----------------+-------------------+-----------------+-------------+---------------+-----------+
| TENANT_ID | TABLE_ID | PARTITION_ID | SUBPARTITION_ID | WEIGHT | DATABASE_NAME | TABLE_NAME | PARTITION_NAME | SUBPARTITION_NAME | TABLEGROUP_NAME | DATABASE_ID | TABLEGROUP_ID | OBJECT_ID |
+-----------+----------+--------------+-----------------+--------+---------------+------------+----------------+-------------------+-----------------+-------------+---------------+-----------+
| 1002 | 500002 | NULL | NULL | 1 | test | tbl1_h | NULL | NULL | NULL | 500001 | NULL | 500002 |
| 1002 | 500002 | 500003 | NULL | 2 | test | tbl1_h | p0 | NULL | NULL | 500001 | NULL | 500003 |
+-----------+----------+--------------+-----------------+--------+---------------+------------+----------------+-------------------+-----------------+-------------+---------------+-----------+
2 rows in set
