Oracle 视图 ALL_USTATS 官方解释,作用,如何使用详细说明

本站中文解释

Oracle视图 ALL_USTATS 按用户名返回一个数据库中指定表和索引统计信息的摘要。它汇总保存在USER_TAB_STATISTICS、USER_INDEX_STATISTICS用户空间表中的信息。

ALL_USTATS 是 ALL_TAB_STATISTICS 和 ALL_INDEX_STATISTICS 交集的统计信息,它创建出单一的、蓝图式的统计数据视图。依据 column_name 列,ALL_USTATS 表示是一列或索引项目。

ALL_USTATS 主要用于跟踪表和索引统计信息,这种统计信息可以在执行优化器决定时提供数据库引擎。因此,它可以帮助 Oracle 识别最佳执行路径以及最合理的功能的使用,使 SQL 申明自动优化和执行。

使用 ALL_USTATS 非常简单,用户只需要选择数据字典视图 ALL_USTATS 以获得表和索引的汇总统计数据。

例如,要查看某个表的统计信息,你可以执行以下 SQL 语句:

SELECT * FROM ALL_USTATS WHERE TABLE_NAME=’表名’;

官方英文解释

ALL_USTATS describes the user-defined statistics collected on the tables and indexes accessible to the current user.

Related Views

  • DBA_USTATS describes the user-defined statistics collected on all tables and indexes in the database.

  • USER_USTATS describes the user-defined statistics collected on the tables and indexes owned by the current user.

Column Datatype NULL Description

OBJECT_OWNER

VARCHAR2(128)

Owner of the table or index for which the statistics have been collected

OBJECT_NAME

VARCHAR2(128)

Name of the table or index for which the statistics have been collected

PARTITION_NAME

VARCHAR2(128)

Partition name of a table; NULL if the table is either nonpartitioned or the entry corresponds to the aggregate statistics for the table

OBJECT_TYPE

VARCHAR2(6)

Type of the object for which statistics have been collected:

  • INDEX

  • COLUMN

ASSOCIATION

VARCHAR2(8)

Statistics type association:

  • DIRECT Direct association with the object for which the statistics have been collected

  • IMPLICIT – Association for which the statistics have been collected is with the column type or index type, and the object is an instance of that column type or index type

COLUMN_NAME

VARCHAR2(128)

Column name, if OBJECT_TYPE is COLUMN, for which statistics have been collected

STATSTYPE_SCHEMA

VARCHAR2(128)

Schema of the statistics type which was used to collect the statistics

STATSTYPE_NAME

VARCHAR2(128)

Name of the statistics type which was used to collect statistics

STATISTICS

RAW(2000)

User-collected statistics for the object

See Also:

  • “DBA_USTATS”

  • “USER_USTATS”


数据运维技术 » Oracle 视图 ALL_USTATS 官方解释,作用,如何使用详细说明