Note
This view is available starting with V4.0.0.
Purpose
This view displays the information about subpartition templates of partitioned tables in the current tenant.
Columns
| Column | Type | Nullable? | Description |
|---|---|---|---|
| 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 | mediumtext | NO | The expression of the partition template. |
| COMPRESSION | varchar(4) | NO | The default value is NULL. This parameter indicates whether the data of each new composite partition added to the subpartition template is stored in a compressed format. Valid values: This parameter can be specified in the subpartition template. |
| INDEXING | varchar(4) | NO | The default value is NULL. This parameter indicates whether the data of each new composite partition added to the subpartition template is considered as a partial index. Valid values: This parameter can be specified in the subpartition template. |
| READ_ONLY | varchar(4) | NO | The default value is NULL. This parameter indicates whether the data of each new composite partition added to the subpartition template is read-only. Valid values: This parameter can be specified in the subpartition template. |
Sample query
Query the information about subpartition templates of partitioned tables in the sys tenant.
obclient [oceanbase]> SELECT * FROM oceanbase.DBA_SUBPARTITION_TEMPLATES;
The query result is as follows:
+-----------+------------+-------------------+-----------------------+-----------------+------------+-------------+----------+-----------+
| USER_NAME | TABLE_NAME | SUBPARTITION_NAME | SUBPARTITION_POSITION | TABLESPACE_NAME | HIGH_BOUND | COMPRESSION | INDEXING | READ_ONLY |
+-----------+------------+-------------------+-----------------------+-----------------+------------+-------------+----------+-----------+
| test | t_m_rclc | mp0 | 1 | NULL | 1,3 | NULL | NULL | NULL |
| test | t_m_rclc | mp1 | 2 | NULL | 4,6 | NULL | NULL | NULL |
| test | t_m_rclc | mp2 | 3 | NULL | 7 | NULL | NULL | NULL |
+-----------+------------+-------------------+-----------------------+-----------------+------------+-------------+----------+-----------+
3 rows in set
References
Query the information about subpartition templates of partitioned tables in all tenants: CDB_SUBPARTITION_TEMPLATES
For information about how to create a partitioned table, see Create a partitioned table.