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 partition template expression. |
| COMPRESSION | varchar(4) | NO | The default value is NULL. This parameter indicates whether the data in each new composite partition added to the subpartition template is stored in a compressed format: This parameter can be specified in the subpartition template. |
| INDEXING | varchar(4) | NO | The default value is NULL. This parameter indicates whether the data in each new composite partition added to the subpartition template is considered to be partially indexed: 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 in each new composite partition added to the subpartition template is read-only: This parameter can be specified in the subpartition template. |
Sample query
Query the information about subpartition templates of partitioned tables in the current user 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 |
+-----------+------------+-------------------+-----------------------+-----------------+------------+-------------+----------+-----------+
| infotest | t2_m_rch | p0 | 1 | NULL | NULL | NULL | NULL | NULL |
| infotest | t2_m_rch | p1 | 2 | NULL | NULL | NULL | NULL | NULL |
| infotest | t2_m_rch | p2 | 3 | NULL | NULL | NULL | NULL | NULL |
| infotest | t2_m_rch | p3 | 4 | NULL | NULL | NULL | NULL | NULL |
| infotest | t2_m_rch | p4 | 5 | NULL | NULL | NULL | NULL | NULL |
+-----------+------------+-------------------+-----------------------+-----------------+------------+-------------+----------+-----------+
5 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.