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: histograms, buckets, and bind variables

Re: histograms, buckets, and bind variables

From: Connor McDonald <hamcdc_at_yahoo.co.uk>
Date: Thu, 18 Nov 2004 12:52:33 +0000 (GMT)
Message-ID: <20041118125233.2800.qmail@web86902.mail.ukl.yahoo.com>


Simple demo for you...

SQL> create table t
  2 as select rownum x, trunc(dbms_random.value(1,100)) y   3 from all_Objects;

Table created.

SQL> analyze table t compute statistics;

Table analyzed.

SQL> select column_name, density
  2 from user_tab_columns
  3 where table_name = 'T';

COLUMN_NAME                       DENSITY
------------------------------ ----------
X                              .000031763
Y                               .01010101

SQL> analyze table t compute statistics for table for all columns;

Table analyzed.

SQL> select column_name, density
  2 from user_tab_columns
  3 where table_name = 'T';

COLUMN_NAME                       DENSITY
------------------------------ ----------
X                              .000031763
Y                              .006666667

different density = possibly different plans....

hth
connor


Connor McDonald
Co-author: "Mastering Oracle PL/SQL - Practical Solutions" ISBN: 1590592174 web: http://www.oracledba.co.uk
web: http://www.oaktable.net
email: connor_mcdonald_at_yahoo.com

Coming Soon! "Oracle Insight - Tales of the OakTable"

"GIVE a man a fish and he will eat for a day. But TEACH him how to fish, and...he will sit in a boat and drink beer all day"


                

Win a castle for NYE with your mates and Yahoo! Messenger http://uk.messenger.yahoo.com
--
http://www.freelists.org/webpage/oracle-l
Received on Thu Nov 18 2004 - 07:06:11 CST

Original text of this message

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