Note
This view is available starting with V4.0.0.
Purpose
This view displays the information about subpartitions of partitioned tables in all tenants.
Columns
| Column | Type | Nullable? | Description |
|---|---|---|---|
| CON_ID | decimal(10,0) | NO | The tenant ID. |
| USER_NAME | varchar(128) | NO | The owner of the partitioned table. |
| TABLE_NAME | varchar(128) | NO | The name of the partitioned table. |
| SUBPARTITION_NAME | varchar(132) | NO | The name of the subpartition. |
| SUBPARTITION_POSITION | bigint(21) | NO | The position of the subpartition. |
| TABLESPACE_NAME | varchar(30) | NO | The name of the tablespace to which the partition belongs. |
| HIGH_BOUND | varchar(262144) | NO | The partition template expression. |
| COMPRESSION | varchar(4) | NO | The default value is NULL. This column indicates whether the data of each new composite partition in the subpartition template is stored in a compressed format: This value can be specified in the subpartition template. |
| INDEXING | varchar(4) | NO | The default value is NULL. This column indicates whether the data of each new composite partition in the subpartition template is considered a partial index: This value can be specified in the subpartition template. |
| READ_ONLY | varchar(4) | NO | The default value is NULL. This column indicates whether the data of each new composite partition in the subpartition template is read-only: This value can be specified in the subpartition template. |
Sample query
Query the information about subpartitions of partitioned tables in all tenants (excluding the Meta tenant) in the sys tenant.
obclient [oceanbase]> SELECT * FROM oceanbase.CDB_SUBPARTITION_TEMPLATES;
The query result is as follows:
+--------+-----------+------------+-------------------+-----------------------+-----------------+------------+-------------+----------+-----------+
| CON_ID | USER_NAME | TABLE_NAME | SUBPARTITION_NAME | SUBPARTITION_POSITION | TABLESPACE_NAME | HIGH_BOUND | COMPRESSION | INDEXING | READ_ONLY |
+--------+-----------+------------+-------------------+-----------------------+-----------------+------------+-------------+----------+-----------+
| 1 | test | t_m_rclc | mp0 | 1 | NULL | 1,3 | NULL | NULL | NULL |
| 1 | test | t_m_rclc | mp1 | 2 | NULL | 4,6 | NULL | NULL | NULL |
| 1 | test | t_m_rclc | mp2 | 3 | NULL | 7 | NULL | NULL | NULL |
| 1002 | infotest | t2_m_rch | p0 | 1 | NULL | NULL | NULL | NULL | NULL |
| 1002 | infotest | t2_m_rch | p1 | 2 | NULL | NULL | NULL | NULL | NULL |
| 1002 | infotest | t2_m_rch | p2 | 3 | NULL | NULL | NULL | NULL | NULL |
| 1002 | infotest | t2_m_rch | p3 | 4 | NULL | NULL | NULL | NULL | NULL |
| 1002 | infotest | t2_m_rch | p4 | 5 | NULL | NULL | NULL | NULL | NULL |
| 1004 | SYS | T2_M_LR | MP0 | 1 | NULL | 100 | NULL | NULL | NULL |
| 1004 | SYS | T2_M_LR | MP1 | 2 | NULL | 200 | NULL | NULL | NULL |
| 1004 | SYS | T2_M_LR | MP2 | 3 | NULL | 300 | NULL | NULL | NULL |
+--------+-----------+------------+-------------------+-----------------------+-----------------+------------+-------------+----------+-----------+
11 rows in set
References
View partitioned tables in the current tenant: DBA_SUBPARTITION_TEMPLATES
For information about how to create a partitioned table: Create a partitioned table