Return-Path: <root@fatcity.cts.com>
Received: from ensim.rackshack.net (root@localhost)
 by orafaq.net (8.11.6/8.11.6) with ESMTP id h1RK0G305693
 for <oracle-l@orafaq.net>; Thu, 27 Feb 2003 14:00:16 -0600
X-ClientAddr: 209.68.248.164
Received: from newsfeed.cts.com (newsfeed.cts.com [209.68.248.164])
 by ensim.rackshack.net (8.11.6/8.11.6) with ESMTP id h1RK0GG05684
 for <oracle-l@orafaq.net>; Thu, 27 Feb 2003 14:00:16 -0600
Received: from fatcity.UUCP (uucp@localhost)
 by newsfeed.cts.com (8.9.3/8.9.3) with UUCP id IAA85088;
 Thu, 27 Feb 2003 08:42:12 -0800 (PST)
Received: by fatcity.com (26-Feb-2001/v1.0g-b72/bab) via UUCP id 0055B736; Thu, 27 Feb 2003 07:04:08 -0800
Message-ID: <F001.0055B736.20030227070408@fatcity.com>
Date: Thu, 27 Feb 2003 07:04:08 -0800
To: Multiple recipients of list ORACLE-L <ORACLE-L@fatcity.com>
X-Comment: Oracle RDBMS Community Forum
X-Sender: "Terrian, Tom (Contractor) (DAASC)" <Tom.Terrian@dla.mil>
Sender: root@fatcity.com
Reply-To: ORACLE-L@fatcity.com
Errors-To: ML-ERRORS@fatcity.com
From: "Terrian, Tom (Contractor) (DAASC)" <Tom.Terrian@dla.mil>
Subject: RE: DBMS_STATS
Organization: Fat City Network Services, San Diego, California
X-ListServer: v1.0g, build 72; ListGuru (c) 1996-2001 Bruce A. Bergman
Precedence: bulk
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit

Thanks to Tim Johnston and Jonathan Lewis.  They were exactly right!

Tom

-----Original Message-----
Sent: Tuesday, February 25, 2003 7:49 PM
To: Multiple recipients of list ORACLE-L


To expand on this, the action level is controlled by the granularity
parameter...

	Granularity of statistics to collect (only pertinent if the table is
partitioned). 

	DEFAULT: Gather global- and partition-level statistics. 

	SUBPARTITION: Gather subpartition-level statistics. 

	PARTITION: Gather partition-level statistics. 

	GLOBAL: Gather global statistics. 


So, in you case, run the following...

execute dbms_stats.gather_table_stats(ownname => 'LDGADMIN', -
                                      tabname => 'LOG_TRANS', -
                                      partname => 'LOG_TRANS_20030102',
                                      estimate_percent => 5,
                                      granularity => 'PARTITION');

See the supplied package reference for more details...

Tim

-----Original Message-----
Sent: Tuesday, February 25, 2003 4:50 PM
To: Multiple recipients of list ORACLE-L



The default action of dbms_stats against
a single partition of a partitioned table is
much more aggressive than a simple
analyze of the partition.

At the least, it does a similar analyze of
the whole table in order to maintain the
global table statistics - you need to set
the granularity of the analyze to stop this
happening.

On a quick test, with sql_trace turned on
and using 9.2.0.2, your choice of parameters
gave me:

Two 5% analyzes of the specified partition,
with a small difference relating to one longish
varchar() column.

One 5% analyze of the whole table.

One 50% analyze of the whole table - restricted
to a much smaller process of a subset of the columns
that omitted the one longish varchar() column.



Regards

Jonathan Lewis
http://www.jlcomp.demon.co.uk

Coming soon one-day tutorials:
Cost Based Optimisation
Trouble-shooting and Tuning
Indexing Strategies
(see http://www.jlcomp.demon.co.uk/tutorial.html )

____UK_______March 19th
____USA_(FL)_May 2nd


Next Seminar dates:
(see http://www.jlcomp.demon.co.uk/seminar.html )

____USA_(CA, TX)_August


The Co-operative Oracle Users' FAQ
http://www.jlcomp.demon.co.uk/faq/ind_faq.html


----- Original Message -----
To: "Multiple recipients of list ORACLE-L" <ORACLE-L@fatcity.com>
Sent: 25 February 2003 18:12


> I have never had good luck with DBMS_STATS.  It seems that the old
analyze runs
> much faster.....
>
> Runs in 45 seconds:
> analyze table log_trans partition (log_trans_20030104) estimate
statistics
> sample 5 percent;
>
> Takes over 2 hours:
> execute dbms_stats.gather_table_stats(ownname => 'LDGADMIN', -
>                                       tabname => 'LOG_TRANS', -
>                                       partname =>
'LOG_TRANS_20030102', -
>                                       estimate_percent => 5);
>
> Am I missing something?  Aren't both commands the same?
>
> Thanks,
> Tom
>

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Jonathan Lewis
  INET: jonathan@jlcomp.demon.co.uk

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@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).
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Johnston, Tim
  INET: TJohnston@quallaby.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@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).
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Terrian, Tom (Contractor) (DAASC)
  INET: Tom.Terrian@dla.mil

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@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).

