Oracle 视图 ALL_TAB_STATISTICS 官方解释,作用,如何使用详细说明
本站中文解释
Oracle视图ALL_TAB_STATISTICS是一个系统视图,用于实现表统计信息的查询。该视图包含关于每个用户或用户拥有的表的TEMP空间统计,例如平均行长度、行数、分区扫描次数等。
使用该视图可以实现对表的统计信息的查询,可以查询表的每个分区的统计数据,以及表的空间使用率,可以为表空间优化提供重要参考数据。
使用示例:
查询test_table表中每个分区的统计数据
SELECT partition_name, num_rows, avg_row_len FROM all_tab_statistics WHERE table_name = ‘TEST_TABLE’;
官方英文解释
ALL_TAB_STATISTICS
displays optimizer statistics for the tables accessible to the current user.
Related Views
-
DBA_TAB_STATISTICS
displays optimizer statistics for all tables in the database. -
USER_TAB_STATISTICS
displays optimizer statistics for the tables owned by the current user. This view does not display theOWNER
column.
Column | Datatype | NULL | Description |
---|---|---|---|
|
|
Owner of the object |
|
|
|
Name of the table |
|
|
|
Name of the partition |
|
|
|
Position of the partition within the table |
|
|
|
Name of the subpartition |
|
|
|
Position of the subpartition within the partition |
|
|
|
Type of the object:
|
|
|
|
Number of rows in the object |
|
|
|
Number of used blocks in the object |
|
|
|
Number of empty blocks in the object |
|
|
|
Average available free space in the object |
|
|
|
Number of chained rows in the object |
|
|
|
Average row length, including row overhead |
|
|
|
Average freespace of all blocks on a freelist |
|
|
|
Number of blocks on the freelist |
|
|
|
Average number of blocks in the buffer cache |
|
|
|
Average cache hit ratio for the object |
|
|
|
Number of In-Memory Compression Units (IMCUs) in the table |
|
|
|
Number of In-Memory blocks in the table |
|
|
|
The timestamp of the most recent update to the In-Memory statistics |
|
|
|
Scan rate for the object in megabytes per second. This statistic is only relevant or meaningful for external tables. |
|
|
|
Sample size used in analyzing the table |
|
|
|
Date of the most recent time the table was analyzed |
|
|
|
|
|
|
|
Indicates whether statistics were entered directly by the user ( |
|
|
|
Type of statistics lock:
|
|
|
|
Indicates whether statistics for the object are stale ( |
|
|
|
Describes some additional properties of the statistics. For example, a value of |
|
|
|
The value is For a global temporary table, the possible values are:
See Oracle Database PL/SQL |
See Also:
-
“DBA_TAB_STATISTICS”
-
“USER_TAB_STATISTICS”
-
Oracle Database PL/SQL
Packages and Types Reference for more information about theDBMS_STATS
package