Name

sys_stat_histogram — Collects a column value histogram for use in SQL optimization

Synopsis

sys_stat_histogram ( in table_name varchar ,
in column_name varchar ,
in n_buckets integer ,
in prec integer );

Description

This function collects (or updates) values distribution data for a given column.

It splits the sorted column values in n_buckets intervals and collects the last value of each interval. The values are then inserted into the SYS_COL_HIST table.

If the table in question has not been analyzed, then it calls SYS_STAT_ANALYZE for the table.

The histograms are then used by the Optimized SQL compiler. All the cached compilations are discarded, because some of them may compile differently in the light of the new data.

Parameters

table_name

The full name of the table exactly as in the KEY_TABLE column of SYS_KEYS.

column_name

The full name of the column exactly as in the COLUMN column in SYS_COLS.

n_buckets

How much intervals to form. If more intervals are available, the estimation of column predicates costs is more precise.

prec

The density of the rows examined. Defaults to 1 (all the rows)