Name

ANALYZE INDEX

Synopsis

ANALYZE INDEX
[schema.]index_name[PARTITION (partition_name)]
   {
   COMPUTE STATISTICS |
ESTIMATE STATISTICS [SAMPLE integer ROWS |
PERCENT] |
   DELETE STATISTICS |
   VALIDATE STRUCTURE
   }

Collects or deletes statistics about an index (index_name), or validates the structure of the index.

Keywords

PARTITION

Specifies one or more partitions ( partition_name) to analyze in a partitioned index.

COMPUTE STATISTICS

Computes the exact statistics for the entire named object and stores them in the data dictionary.

ESTIMATE STATISTICS

Estimates statistics for the named object and stores them in the data dictionary. A SAMPLE may be specified: ROWS causes integer rows of a table or cluster, or integer entries from an index, to be sampled. PERCENT causes integer percent of the rows of a table or cluster, or integer percent of the entries, of an index, to be sampled. The valid range for PERCENT is 1- 99.

DELETE STATISTICS

Causes all statistics stored in the data dictionary for the named object to be deleted.

VALIDATE STRUCTURE

Causes the structure of the named object to be validated. Oracle will place a lock on the table during this operation.

Notes

You must own the object to be analyzed or have the ANALYZE ANY privilege to issue this command. COMPUTE STATISTICS will result in more accurate statistics, but is likely to take longer. ESTIMATE STATISTICS will normally be much faster and almost as accurate. Statistics are stored in the DBA_INDEXES, DBA_IND_PARTITIONS, and DBA_PART_INDEXES data dictionary views.

If you use the VALIDATE STRUCTURE clause, Oracle will also populate the INDEX_STATS data dictionary view.

Example

The following example analyzes scott’s emppk index using a 50% sample:

ANALYZE INDEX scott.emppk ESTIMATE STATISTICS SAMPLE 50 PERCENT
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.116.42.149