Friday, November 04, 2005

Oracle: Histograms

When to use histograms:
1. When the columns are used frequently in where clauses.
2. it's hightly skewed data distribution.

Creating Histograms:
- execute DBMS_STATS.GATHER_TABLE_STATS
('scott','emp', METHOD_OPT => 'FOR COLUMNS SIZE 10 sal');
( create a 10 bucket histograms on sal column of emp table)

The default number of buckets is 75

0 Comments:

Post a Comment

<< Home