Oracle FAQ Your Portal to the Oracle Knowledge Grid

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Global Stats

Re: Global Stats

From: Jay Hostetter <>
Date: Tue, 28 Jan 2003 11:44:38 -0800
Message-ID: <>


  On our "home grown" partitioned databases, I am still using the ANALYZE command for partitions. There were some bugs associated with DBMS_STATS and partitions, although I don't remember the specifics at the moment (it may have been with 8.1.6). I haven't had a chance to go back and see if we want to switch to DBMS_STATS.   On our 11i database (8.1.7), Oracle provided scripts specifically check to make sure that global stats to not exist on partitioned tables (search for bde_last_analyzed.sql on MetaLink). We analyze these tables with FND_STATS and a granularity of PARTITION.   Others may have more specific info on where the issue stands beyond 8.1.7.

Jay Hostetter
Oracle DBA
D. & E. Communications
Ephrata, PA USA

>>> 01/28/03 02:10PM >>>
Hi everyone,

Back to the lovely world of Oracle :) I've been reading up on statistics. Out of the 8.1.7 doco:
Partitioned schema objects may contain multiple sets of statistics. They can have statistics which refer to the entire schema object as a whole (global statistics), they can have statistics which refer to an individual partition, and they can have statistics which refer to an individual subpartition of a composite partitioned object.

Unless the query predicate narrows the query to a single partition, the optimizer uses the global statistics. Because most queries are not likely to be this restrictive, it is most important to have accurate global statistics. Intuitively, it may seem that generating global statistics from partition-level statistics should be straightforward; however, this is only true for some of the statistics. For example, it is very difficult to figure out the number of distinct values for a column from the number of distinct values found in each partition because of the possible overlap in values. Therefore, actually gathering global statistics with the DBMS_STATS package is highly recommended, rather than calculating them with the ANALYZE statement

The table I need to generate stats for is currently 32GB and grows by ~2GB per week. Even the smallest estimate with calculating global stats will take a long long time and I may not be able to spring for all the required temp space.

How does the list feel about global stats? Does anyone agree with the documentation that they "most important"? I'm thinking my partitioned statistics are the "most important".

Any input is appreciated. Thanks

Lisa Koivu
Oracle Database Administrator
Fairfield Resorts, Inc.
5259 Coconut Creek Parkway
Ft. Lauderdale, FL, USA 33063

This e-mail message and any files transmitted with it are intended for the use of the individual or entity to which they are addressed and may contain information that is privileged, proprietary and confidential. If you are not the intended recipient, you may not use, copy or disclose to anyone the message or any information contained in the message. If you have received this communication in error, please notify the sender and delete this e-mail message. The contents do not represent the opinion of D&E except to the extent that it relates to their official business.

Please see the official ORACLE-L FAQ:
Author: Jay Hostetter

Fat City Network Services    -- 858-538-5051
San Diego, California        -- Mailing list and web hosting services
To REMOVE yourself from this mailing list, send an E-Mail message
to: (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 Tue Jan 28 2003 - 13:44:38 CST

Original text of this message