Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: Performance of DBMS_STATS vs ANALYZE
Hi Connor
Notice that your analyze command did not calculate column stats, but the dbms_stats did. You'll
get a "fairer" assessment if you analyze command is:
ANALYZE TABLE myschema.<table> ESTIMATE STATISTICS SAMPLE <<n>> PERCENT
FOR TABLE FOR ALL INDEXES
for all columns size 1;
--
Thanks for the suggestion - if I gather columns stats using ANALYZE it does slow things down a bit. It is still 2x faster than DBMS_STATS, but not 3 or 4x as it was before.
But ideally I'd like make DBMS_STATS faster, not ANALYZE slower :-) Are these 1-bucket histograms on each column useful to the CBO? If not, can they be turned off (METHOD_OPT=>'FOR ALL COLUMNS SIZE 0' doesn't do anything).
As Jonathan Lewis also suggested, perhaps I'm dwelling on this more than I need to - but I'm curious!
Thanks
- Charlotte
![]() |
![]() |