Note
- This view is available starting with V4.4.1 for V4.4.x.
- This view is available starting with V4.2.5 BP2 for V4.2.5.
Purpose
The CDB_OB_OBJECT_BALANCE_WEIGHT view displays all partitions with special weights in all user tenants.
Columns
| Column | Type | Nullable | Description |
|---|---|---|---|
| TENANT_ID | bigint(20) | NO | The tenant ID. |
| TABLE_ID | bigint(20) | NO | The table ID. |
| PARTITION_ID | bigint(20) | NO | The ID of the partition. If no weight is set for the partition, the value is NULL. |
| SUBPARTITION_ID | bigint(20) | NO | The ID of the subpartition. If no weight is set for the subpartition, the value is NULL. Currently, setting the weight of a subpartition is not supported. |
| WEIGHT | bigint(20) | NO | The weight of the partition. |
| DATABASE_NAME | varchar(128) | NO | The name of the database to which the table belongs. |
| TABLE_NAME | varchar(256) | NO | The name of the table. |
| PARTITION_NAME | varchar(64) | NO | The name of the partition. |
| SUBPARTITION_NAME | varchar(64) | NO | The name of the subpartition. |
| TABLEGROUP_NAME | varchar(128) | NO | The name of the table group to which the table belongs. |
| DATABASE_ID | bigint(20) | NO | The ID of the database to which the table belongs. |
| TABLEGROUP_ID | bigint(20) | NO | The ID of the table group to which the table belongs. |
| OBJECT_ID | bigint(20) | NO | The ID of the object to which the table belongs. |
Sample query
In the sys tenant, query the partitions with special weights in the user tenant with ID 1002.
obclient(root@sys)[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