Note
This view is available starting with V4.0.0.
Purpose
This view displays the partition information of all partitioned tables in the current tenant.
Columns
| Column | Type | Nullable? | Description |
|---|---|---|---|
| TABLE_OWNER | varchar(128) | NO | The user who owns the partitioned table. |
| TABLE_NAME | varchar(128) | NO | The name of the partitioned table. |
| COMPOSITE | varchar(3) | NO | Indicates whether the partition is a composite partition. |
| PARTITION_NAME | varchar(128) | NO | The name of the partition. |
| SUBPARTITION_COUNT | bigint(20) | NO | The number of subpartitions. |
| HIGH_VALUE | mediumtext | NO | The partitioning expression. |
| HIGH_VALUE_LENGTH | bigint(20) | NO | The length of the partitioning expression. |
| PARTITION_POSITION | bigint(20) | NO | The position of the partition. |
| TABLESPACE_NAME | varchar(30) | NO | The name of the tablespace to which the partition belongs. |
| PCT_FREE | bigint(0) | NO | This column is not supported. The default value is NULL. |
| PCT_USED | bigint(0) | NO | This column is not supported. The default value is NULL. |
| INI_TRANS | bigint(0) | NO | This column is not supported. The default value is NULL. |
| MAX_TRANS | bigint(0) | NO | This column is not supported. The default value is NULL. |
| INITIAL_EXTENT | bigint(0) | NO | This column is not supported. The default value is NULL. |
| NEXT_EXTENT | bigint(0) | NO | This column is not supported. The default value is NULL. |
| MIN_EXTENT | bigint(0) | NO | This column is not supported. The default value is NULL. |
| MAX_EXTENT | bigint(0) | NO | This column is not supported. The default value is NULL. |
| MAX_SIZE | bigint(0) | NO | This column is not supported. The default value is NULL. |
| PCT_INCREASE | bigint(0) | NO | This column is not supported. The default value is NULL. |
| FREELISTS | bigint(0) | NO | This column is not supported. The default value is NULL. |
| FREELIST_GROUPS | bigint(0) | NO | This column is not supported. The default value is NULL. |
| LOGGING | varchar(7) | NO | This column is not supported. The default value is NULL. |
| COMPRESSION | varchar(8) | NO | Indicates whether compression is enabled. |
| COMPRESS_FOR | varchar(30) | NO | The compression method. |
| NUM_ROWS | bigint(0) | NO | This column is not supported. The default value is NULL. |
| BLOCKS | bigint(0) | NO | This column is not supported. The default value is NULL. |
| EMPTY_BLOCKS | bigint(0) | NO | This column is not supported. The default value is NULL. |
| AVG_SPACE | bigint(0) | NO | This column is not supported. The default value is NULL. |
| CHAIN_CNT | bigint(0) | NO | This column is not supported. The default value is NULL. |
| AVG_ROW_LEN | bigint(0) | NO | This column is not supported. The default value is NULL. |
| SAMPLE_SIZE | bigint(0) | NO | This column is not supported. The default value is NULL. |
| LAST_ANALYZED | date | NO | This column is not supported. The default value is NULL. |
| BUFFER_POOL | varchar(7) | NO | This column is not supported. The default value is NULL. |
| FLASH_CACHE | varchar(7) | NO | This column is not supported. The default value is NULL. |
| CELL_FLASH_CACHE | varchar(7) | NO | This column is not supported. The default value is NULL. |
| GLOBAL_STATS | varchar(3) | NO | This column is not supported. The default value is NULL. |
| USER_STATS | varchar(3) | NO | This column is not supported. The default value is NULL. |
| IS_NESTED | varchar(3) | NO | This column is not supported. The default value is NULL. |
| PARENT_TABLE_PARTITION | varchar(128) | NO | This column is not supported. The default value is NULL. |
| INTERVAL | varchar(3) | NO | This column is not supported. The default value is NO. |
| SEGMENT_CREATED | varchar(4) | NO | This column is not supported. The default value is NULL. |
| INDEXING | varchar(4) | NO | This column is not supported. The default value is NULL. |
| READ_ONLY | varchar(4) | NO | This column is not supported. The default value is NULL. |
| INMEMORY | varchar(8) | NO | This column is not supported. The default value is NULL. |
| INMEMORY_PRIORITY | varchar(8) | NO | This column is not supported. The default value is NULL. |
| INMEMORY_DISTRIBUTE | varchar(15) | NO | This column is not supported. The default value is NULL. |
| INMEMORY_COMPRESSION | varchar(17) | NO | This column is not supported. The default value is NULL. |
| INMEMORY_DUPLICATE | varchar(13) | NO | This column is not supported. The default value is NULL. |
| CELLMEMORY | varchar(24) | NO | This column is not supported. The default value is NULL. |
| INMEMORY_SERVICE | varchar(12) | NO | This column is not supported. The default value is NULL. |
| INMEMORY_SERVICE_NAME | varchar(100) | NO | This column is not supported. The default value is NULL. |
| MEMOPTIMIZE_READ | varchar(8) | NO | This column is not supported. The default value is NULL. |
| MEMOPTIMIZE_WRITE | varchar(8) | NO | This column is not supported. The default value is NULL. |
Sample query
Query the primary partitions of the t2_m_rch table in the current user tenant.
obclient [oceanbase]> SELECT TABLE_OWNER, TABLE_NAME, COMPOSITE, PARTITION_NAME, SUBPARTITION_COUNT, HIGH_VALUE_LENGTH, PARTITION_POSITION
FROM oceanbase.DBA_TAB_PARTITIONS
WHERE TABLE_NAME='t2_m_rch';
The query result is as follows:
+-------------+------------+-----------+----------------+--------------------+-------------------+--------------------+
| TABLE_OWNER | TABLE_NAME | COMPOSITE | PARTITION_NAME | SUBPARTITION_COUNT | HIGH_VALUE_LENGTH | PARTITION_POSITION |
+-------------+------------+-----------+----------------+--------------------+-------------------+--------------------+
| infotest | t2_m_rch | YES | p0 | 5 | 3 | 1 |
| infotest | t2_m_rch | YES | p1 | 5 | 3 | 2 |
| infotest | t2_m_rch | YES | p2 | 5 | 3 | 3 |
+-------------+------------+-----------+----------------+--------------------+-------------------+--------------------+
3 rows in set
References
Query the primary partitions of all tenants' tables: CDB_TAB_PARTITIONS
Query the subpartitions of the current tenant's tables: DBA_TAB_SUBPARTITIONS