RE: updating statistics

RE: updating statistics

 

  

Kevin

I'm glad you have raised this question, because I was in the process posting
a related question to the list.

Firstly to answer you question.

ANALYZE TABLE foobar COMPUTE STATISTICS;

Will calculate the statistics of all the data in the foobar table. The
Oracle cost based optimiser will use these statistics, to determine the
lowest cost to perform DML on the foobar table. If foobar was to contain a
large number of rows, instead of COMPUTE STATISTICS you can ESTIMATE
STATISTICS. The difference being that, the COMPUTE option will scan all
rows in the table, whereas ESTIMATE scans some of the table rows and makes
predictions about the remaining rows.
Look up the ANALYZE command for more detail on the command and the Concepts
Guide under The Optimiser for a fuller description of the general concept.

I have two related questions:
Q. How does one determine the frequency on analysing tables, in a
hybrid database.
Q. What are common threasholds from switching from COMPUTE to
ESTIMATE.

Cheers
Jeremy

-----Original Message-----
From: Sexton, Kevin [mailto:kevin.[Email Address Removed] Friday, 1 February 2002 10:53 AM
To: LazyDBA.com Discussion
Subject: updating statistics


I just dropped and recreated several tables and someone told me I need
to reload the statistics? Help?

-Kevin

Oracle LazyDBA home page