[PT]Something about Optimizer Statistics

1. DBMS_STATS gathers only statistics needed for optimization; it does not gather other statistics. For example, the table statistics gathered by DBMS_STATS include the number of rows, number of blocks currently containing data, and average row length, but not the number of chained rows, average free space, or number of unused data blocks.

2. Oracle Database automatically collects index statistics whenever an index is created or rebuilt. Exceptions are domain indexes, or indexes created while the base table is empty.

3. The optimizer uses the following criteria when determining which index to use:

Number of rows in the index (cardinality)

Number of distinct keys (defining the selectivity of the index)

Level or height of the index (indicating how deeply the data probe must search to find the data)

Number of leaf blocks in the index (number of I/Os needed to find the desired rows of data)

Average leaf blocks for each key (ALFBKEY): This is the average number of leaf blocks in which each distinct value in the index appears, rounded to the nearest integer. For indexes that enforce UNIQUE and PRIMARY KEY constraints, this value is always 1.

Average number of data blocks in the table that are pointed to by a distinct value in the index, rounded to the nearest integer: This statistic is the average number of data blocks that contain rows that contain a given value for the indexed columns.

4. Whenever optimizer statistics are modified using the DBMS_STATS package, old versions of the statistics are saved automatically for future restoration. Statistics can be restored using the RESTORE procedures of the DBMS_STATS package. However, old versions of statistics are not stored when the ANALYZE command has been used for collecting statistics. Retention is configurable using the ALTER_STATS_HISTORY_RETENTION procedure.

[@more@]

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/8558093/viewspace-1022379/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/8558093/viewspace-1022379/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值