Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Diff. ANALYZE/ANALYZE FOR ALL COLUMNS ??
Spendius wrote:
> I've found noticeable differences between the different
> options of the ANALYZE TABLE command (in 8i):
>
>>analyze table sc.xxx estimate statistics;
>>analyze table sc.xxx estimate statistics for all columns;
"analyze table ..."
Analyzes the table and all indexes.
"analyze table ... for all columns"
Creates histograms for the all columns of the table but does *NOT*
analyze the table or indexes. BTW I was never sure why anyone would want
to do this as the histograms will only make a difference on indexed
columns. There's probably some feature of oracle that uses these stats
but I don't know what it is.
"analyze table ... for table for all indexes for all indexed columns" Will analyze the table, the indexes, and created histograms for just the indexed columns. These histograms help the optimizer decide whether to use a table scan or index scan when including those columns in the WHERE clause. They really only need to be created for columns with highly skewed values though (like if one value occurs in 90% of the rows).
-- To reply by email remove "_nospam"Received on Fri Jan 28 2005 - 13:12:16 CST
![]() |
![]() |