Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: Analyze - For All option
There is plenty of documentation on these commands which I suggest reading, but to summarise obscenely...
These options can be used to analyze just certain elements whilst leaving other statistics unchanged. If you rebuilt the indexes on a table you might want to simply "analyze table blah for all indexes" just to gather stats on the indexes. Also, they can be used to create histograms. Histograms report on the distribution of data. Say you have an index on gender and 99% of the records were male.... Summing the age of all males would be best done using a full table scan, summing the females may be better by using the index and single row lookups. Without a histogram the optimisor would have said "only 2 distinct values so scan the tables for females too" not knowing how rare a female record is in the table.
Warning - histograms (from my really brief description) sound really good and you may ask yourself "why not create them everywhere". They aren't that good except in specific instances. In other scenario's they just slow the optimisor down (while it scans the histogram) and provide no benefit. You need to learn "when" to use a histogram.
Regards,
Mark.
"quriyat " <quriyat_at_myway.co To: Multiple recipients of list ORACLE-L <ORACLE-L_at_fatcity.com> m> cc: Sent by: Subject: Analyze - For All option ml-errors_at_fatcity .com 17/10/2003 09:54 Please respond to ORACLE-L
Hi List
Can anyone enlighten me on the diff between
ANALYZE TABLE COMPUTE STATISTICS
--AND--
analyze table my_emp compute statistics for table for all indexes
for all indexed columns;
TIA
-- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: quriyat INET: quriyat_at_myway.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_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-LReceived on Thu Oct 16 2003 - 20:44:25 CDT
(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing). <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<---->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Privileged/Confidential information may be contained in this message. If you are not the addressee indicated in this message (or responsible for delivery of the message to such person), you may not copy or deliver this message to anyone. In such case, you should destroy this message and kindly notify the sender by reply e-mail or by telephone on (61 3) 9612-6999. Please advise immediately if you or your employer does not consent to Internet e-mail for messages of this kind. Opinions, conclusions and other information in this message that do not relate to the official business of Transurban City Link Ltd shall be understood as neither given nor endorsed by it. <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<---->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<---->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Privileged/Confidential information may be contained in this message. If you are not the addressee indicated in this message (or responsible for delivery of the message to such person), you may not copy or deliver this message to anyone. In such a case, you should destroy this message and kindly notify the sender by reply e-mail or by telephone on (03) 9612-6999 or (61) 3 9612-6999. Please advise immediately if you or your employer does not consent to Internet e-mail for messages of this kind. Opinions, conclusions and other information in this message that do not relate to the official business of Transurban Infrastructure Developments Limited and CityLink Melbourne Limited shall be understood as neither given nor endorsed by them. <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<---->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Mark Richard INET: mrichard_at_transurban.com.au 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_at_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).