Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Creating Histograms

Re: Creating Histograms

From: Wolfgang Breitling <breitliw_at_centrexcc.com>
Date: Wed, 21 Jul 2004 13:40:03 -0600
Message-Id: <6.1.0.6.2.20040721132911.02d240e0@pop.centrexcc.com>


You create histograms on individual columns with gather_table_stats. Gathering histograms is a very selective process - both, on which column(s) and with what number of buckets. It is not something you ought to do with a broad stroke like gather_schema_stats. One size (pun intended) certainly does not fit all.

Once you gathered the histograms in this way for the columns where it benefits performance, you can use method_opt=>'for all columns size repeat' in gather_schema_stats to re-gather the histograms - according to the documentation, I have not verified that myself.

All that provided you insist on doing the regular gather_schema_stats russian roulette.

The values for all (analyzed) tables in dba_histograms are OK. Capturing min and max column values can be viewed as a 1-bucket histogram (bounded by lowest and highest column value), which is what the default method_opt=>'for all columns size 1' also implies - a histogram of size one for all columns..

PS. An easy way to find which columns are used in predicates, and one which Oracle uses when you use method_opt=>'... size auto', is to query sys.col_usage$.

Regards

Wolfgang Breitling
Centrex Consulting Corporation
http://www.centrexcc.com



Please see the official ORACLE-L FAQ: http://www.orafaq.com

To unsubscribe send email to: oracle-l-request_at_freelists.org put 'unsubscribe' in the subject line.
--

Archives are at http://www.freelists.org/archives/oracle-l/ FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
Received on Wed Jul 21 2004 - 14:40:59 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US