Automatic Stats Gathering
785360Mar 7 2011 — edited Mar 8 2011Hi Xperts
I'd like to ask why sometimes people use schema or table level stats gathering in addition to automatic stats gathering feature.
For example, I usually see the following blocks in shell scripts scheduled via cron scheduler (at say 7 PM every Friday):
BEGIN
dbms_stats.gather_schema_stats (
ownname => 'SCHEMANAME',
estimate_percent => dbms_stats.auto_sample_size,
granularity=>'ALL',
options => 'GATHER',
cascade=>true);
END;
/
and the gather stats job is scheduled as well.
I agree that for some tables (high load, volatile), stats should be left blank and locked for dynamic sampling (lvl 2) and so on, but is it (example ablove) something done to specifically touch the schema/table stats at a particular time? Isn't it something redundant and can be done away with? I can't think of much reasons behind this logic.. any thoughts?
L0 DBA Jr.