Optimizer Statistics
Optimizer Statistics
The optimizer cost model relies on statistics collected about the objects involved in a query,
and the database and host where the query runs.
The optimizer uses statistics to get an estimate of the number of rows (and number of
bytes) retrieved from a table, partition, or index. The optimizer estimates the cost for the
access, determines the cost for possible plans, and then picks the execution plan with the
lowest cost.
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.
Note:
The optimizer statistics are different from the performance statistics visible
through V$ views