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: dbms_stats

RE: dbms_stats

From: Wolfgang Breitling <breitliw_at_centrexcc.com>
Date: Wed, 03 Dec 2003 22:14:25 -0800
Message-ID: <F001.005D8B4C.20031203221425@fatcity.com>


Maybe I didn't make my point clear enough. If you use dbms_stats.gather_table_stats with " method_opt=>''for all indexed columns size 2' ", i.e. any other than size 1, dbms_stats in Oracle 8i will issue an "analyze ... " command to gather the statistics. Run a sql_trace if you don't believe me. Therefore the results of gathering statistics with dbms_stats are no different than gathering them with the equivalent analyze command.
It is different if you use the default method_opt (for all columns size 1). Then gather_table_stats uses its own sql to collect table and column ( num_distinct, min, max, null, avg_col_length) statistics. For index statistics always resorts to the analyze command.

That all changes in Oracle 9i. There the gather procedures do their own work and do not use analyze anymore.

How did you determine the bucket size of 2?

And no, I have not had any issues with analyze for partitioned tables; however, I do not gather histograms blindly on all indexed columns. Only on a few columns with highly skewed data content and some of them are on partitioned tabled.

At 09:29 PM 12/3/2003, you wrote:
>The reason why we switched from 'analyze table .. 10 percent' is because
>when we partitioned some of the huge tables, the query performance against
>these tables was really bad. 'Gather_table_stats' with size 2 on indexed
>columns did a much better job.
>
>Have you had issues with 'analyze' against partitioned tables?
>
>-----Original Message-----
>Wolfgang Breitling
>Sent: Wednesday, December 03, 2003 5:29 PM
>To: Multiple recipients of list ORACLE-L
>
>
>In Oracle 8i you may as well stick with analyze since the dbms_stats call
>you use translates simply into a
>
> "analyze table ... ESTIMATE statistics sample 10 percent FOR TABLE FOR
>ALL INDEXES for all indexed columns size 2"
>
>Why did you go from a simple analyze to gathering histograms on all indexed
>columns? I question the rationale of gathering histograms of "size 2".
>Aside from that, I question the rationale of a blanket histogram gathering
>(regardless of # of buckets) on "all indexed" or "all" columns. Histograms
>are like medicine. In the right (i.e. sparing dose) they are a therapeutic
>tool. In the wrong, especially too high dose, they become poison.

Wolfgang Breitling
Oracle7, 8, 8i, 9i OCP DBA
Centrex Consulting Corporation
http://www.centrexcc.com

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Wolfgang Breitling
  INET: breitliw_at_centrexcc.com

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Thu Dec 04 2003 - 00:14:25 CST

Original text of this message

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