Note
This view is introduced in OceanBase Database V4.0.0.
Purpose
This view displays the columns that are subpartition keys in all partitioned objects in the current tenant.
Columns
| Column | Type | Nullable? | Description |
|---|---|---|---|
| OWNER | varchar(128) | NO | The owner of the partitioned table or partitioned index. |
| NAME | varchar(128) | NO | The name of the partitioned table or partitioned index. |
| OBJECT_TYPE | varchar(5) | NO | The type of the partitioned object: |
| COLUMN_NAME | text | NO | The name of the column. |
| COLUMN_POSITION | bigint(21) | NO | The position of the column in the partitioning key. |
| COLLATED_COLUMN_ID | bigint(0) | NO | This column is not supported. The default value is NULL. |
Sample query
Query the columns that are subpartition keys in the partitioned table tbl2_f_rl in the user tenant.
obclient [oceanbase]> SELECT * FROM oceanbase.DBA_SUBPART_KEY_COLUMNS WHERE NAME='tbl2_f_rl';
The query result is as follows:
+----------+-----------+-------------+-------------+-----------------+--------------------+
| OWNER | NAME | OBJECT_TYPE | COLUMN_NAME | COLUMN_POSITION | COLLATED_COLUMN_ID |
+----------+-----------+-------------+-------------+-----------------+--------------------+
| infotest | tbl2_f_rl | TABLE | col2 | 1 | NULL |
+----------+-----------+-------------+-------------+-----------------+--------------------+
1 row in set
References
To view the columns that are subpartition keys in all partitioned objects in all tenants, see CDB_SUBPART_KEY_COLUMNS.