Showing posts with label Query Optimizer. Show all posts
Showing posts with label Query Optimizer. Show all posts

Sep 28, 2012

Oracle Histogram

                       Histograms are used to predict cardinality and the number of rows returned to a query .The Oracle Query Optimizer uses histograms to predict better query plans. The ANALYZE command or DBMS_STATS package can be used to compute these histograms.A histogram is a frequency distribution meta-data that describes the distribution of data values within a column of a table.A histogram is a collection of information about the distribution of values within a column.

In some cases, the distribution of values within a column of a table will affect the optimizers decision to use an index vs. perform a full-table scan. This scenario occurs when the value with a where clause has a disproportional amount of values, making a full-table scan cheaper than index access.

Histograms are also important for determine the optimal table join order.