Histograms
The cost-based optimizer assumes that the values for a column are evenly distributed. For instance, if there are two distinct values in a column, the cost-based optimizer assumes that each value applies to 50% of the entries in the column.
This assumption can be incorrect for columns with extreme data value skew and can result in the optimizer’s making the wrong choice for an execution plan. You can create histograms to avoid this potential problem.
Introduced with Oracle8i, histograms give the optimizer a more detailed view of the distribution of data values in the column. You can create a histogram with procedures in the DBMS_STATS package. Histograms require some overhead, so you should not use them, by default, for all columns, but they can help to improve the accuracy of execution plans involving some columns with low selectivity.
Histograms were introduced with Oracle8i.