Note
This view was introduced in V3.2.1.
Purpose
This view displays optimizer statistics for all tables in the current tenant.
Columns
| Column | Type | Nullable? | Description |
|---|---|---|---|
| OWNER | VARCHAR2(128) | NO | The name of the user who owns the entity. |
| TABLE_NAME | VARCHAR2(128) | NO | The name of the table. |
| PARTITION_NAME | VARCHAR2(128) | NO | The name of the partition. |
| PARTITION_POSITION | NUMBER | NO | The position of the partition in the table. |
| SUBPARTITION_NAME | VARCHAR2(128) | NO | The name of the subpartition. |
| SUBPARTITION_POSITION | NUMBER | NO | The position of the subpartition in the partition. |
| OBJECT_TYPE | VARCHAR2(12) | NO | The type of the entity. |
| NUM_ROWS | NUMBER | NO | The number of rows in the entity. |
| BLOCKS | NUMBER | NO | Not supported. The default value is NULL. |
| EMPTY_BLOCKS | NUMBER | NO | Not supported. The default value is NULL. |
| AVG_SPACE | NUMBER | NO | Not supported. The default value is NULL. |
| CHAIN_CNT | NUMBER | NO | Not supported. The default value is NULL |
| AVG_ROW_LEN | NUMBER | NO | The average row length of the entity. |
| AVG_SPACE_FREELIST_BLOCKS | NUMBER | NO | Not supported. The default value is NULL |
| NUM_FREELIST_BLOCKS | NUMBER | NO | Not supported. The default value is NULL |
| AVG_CACHED_BLOCKS | NUMBER | NO | Not supported. The default value is NULL |
| AVG_CACHE_HIT_RATIO | NUMBER | NO | Not supported. The default value is NULL |
| IM_IMCU_COUNT | NUMBER | NO | Not supported. The default value is NULL |
| IM_BLOCK_COUNT | NUMBER | NO | Not supported. The default value is NULL |
| IM_STAT_UPDATE_TIME | TIMESTAMP(9) | NO | Not supported. The default value is NULL |
| SCAN_RATE | NUMBER | NO | Not supported. The default value is NULL |
| SAMPLE_SIZE | NUMBER | NO | The sample size used when statistics are collected. |
| LAST_ANALYZED | DATE | NO | The time when the statistics were last analyzed. |
| GLOBAL_STATS | VARCHAR2(3) | NO | YES: The statistics are directly collected or incrementally maintained.NO: Other cases |
| USER_STATS | VARCHAR2(3) | NO | Whether the partition statistics are user-defined. |
| STATTYPE_LOCKED | VARCHAR2(5) | NO | The type of statistics lock. |
| STALE_STATS | VARCHAR2(3) | NO | Whether the statistics are stale. |
| SCOPE | VARCHAR2(7) | NO | The scope of the statistics. |
Sample query
Query the optimizer statistics of the T_SUBPART table in all tables in the current tenant.
obclient [SYS]> SELECT OWNER, TABLE_NAME, OBJECT_TYPE, NUM_ROWS, AVG_ROW_LEN FROM SYS.DBA_TAB_STATISTICS WHERE TABLE_NAME = 'T_SUBPART' ORDER BY 1, 2, 3;
The query result is as follows:
+-------+------------+--------------+----------+-------------+
| OWNER | TABLE_NAME | OBJECT_TYPE | NUM_ROWS | AVG_ROW_LEN |
+-------+------------+--------------+----------+-------------+
| SYS | T_SUBPART | PARTITION | 2530 | 60 |
| SYS | T_SUBPART | PARTITION | 4966 | 60 |
| SYS | T_SUBPART | PARTITION | 2504 | 60 |
| SYS | T_SUBPART | SUBPARTITION | 829 | 60 |
| SYS | T_SUBPART | SUBPARTITION | 1141 | 60 |
| SYS | T_SUBPART | SUBPARTITION | 560 | 60 |
| SYS | T_SUBPART | SUBPARTITION | 1122 | 60 |
| SYS | T_SUBPART | SUBPARTITION | 2714 | 60 |
| SYS | T_SUBPART | SUBPARTITION | 1130 | 60 |
| SYS | T_SUBPART | SUBPARTITION | 549 | 60 |
| SYS | T_SUBPART | SUBPARTITION | 1125 | 60 |
| SYS | T_SUBPART | SUBPARTITION | 830 | 60 |
| SYS | T_SUBPART | TABLE | 10000 | 60 |
+-------+------------+--------------+----------+-------------+
13 rows in set
References related to the topic
To view the optimizer statistics of tables that the current user can access, see ALL_TAB_STATISTICS.
To view the optimizer statistics of tables owned by the current user, see USER_TAB_STATISTICS.
For global-level column statistics, query the following views:
For partition-level column statistics, query the following views:
For subpartition-level column statistics, query the following views:
For table-level histogram statistics, query the following views:
For partition-level histogram statistics, query the following views:
For subpartition-level histogram statistics, query the following views:
For index statistics, query the following views:
For more information about how to collect statistics, see the following topics: