欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Introduction to Optimizer Statistics

程序员文章站 2022-04-26 11:18:35
...
The optimizer cost model relies on statistics collected about the objects involved in a query, and the database and host where the query runs.

Statistics are critical to the optimizer's ability to pick the best execution plan for a SQL statement.

Optimizer statistics include the following:

Table statistics

Number of rows
Number of blocks
Average row length

Column statistics

Number of distinct values (NDV) in a column
Number of nulls in a column
Data distribution (histogram)
Extended statistics

Index statistics

Number of leaf blocks
Number of levels
Index clustering factor
System statistics

I/O performance and utilization
CPU performance and utilization
As shown in Figure 10-1, the database stores optimizer statistics for tables, columns, indexes, and the system in the data dictionary. You can access these statistics using data dictionary views.

Introduction to Optimizer Statistics

转载于:https://blog.51cto.com/roidba/2071989