| |
 |
|
Oracle Tips by Burleson |
Collecting Statistics
You can collect statistics about the
physical storage characteristics and data distribution of an index,
table, column, or cluster, and store them as histograms in the data
dictionary. For computing or estimating statistics, computation
always provides exact values but can take longer than estimation,
and requires large amounts of temporary tablespace (up to four times
the size of your largest table). Estimation is often much faster
than computation, and the results are usually nearly exact. You
cannot compute or estimate histogram statistics for the following
column types:
-
REFs
-
varrays
-
nested tables
-
LOBs
-
LONGs
-
object types
Use estimation, rather than computation,
unless you feel you need exact values. Some statistics are always
computed exactly, regardless of whether you specify computation or
estimation. If you choose estimation, and the time saved by
estimating a statistic is negligible, Oracle computes the statistic
exactly.
If the data dictionary already contains
statistics for the analyzed object, Oracle updates the existing
statistics with the new ones.
ANALYZE Myths
Since ANALYZE was introduced, many myths
about its use have been circulated. Some of the more harmful ones
are:
-
You need to ANALYZE entire schema.
-
ANALYZE does a full row count no
matter what.
-
You can sample 5 to 10 percent and
get good results.
-
You can sample 50 rows and get
good results.
See Code Depot

www.oracle-script.com |