When using DBMS_STATS to gather statistics, we need a method to choose which objects to gather statistics for. This is done by the parameter “OPTIONS”. The possible values for this parameter are
- GATHER AUTO
- GATHER STALE
- GATHER EMPTY
- LIST AUTO
- LIST EMPTY
- LIST STALE
Of the above, GATHER AUTO & GATHER STALE confuse many – let’s see what’s the main difference between the two.
GATHER STALE: Oracle gathers statistics on stale objects as determined by looking at the *_tab_modifications views. The estimate percent & degree have to be provided by the user.
GATHER AUTO : Oracle decides which objects to gather fresh statistics for and also decides how to get them. Oracle determines the estimate percent to be used. The parallelism used is based on the init.ora setting. This also used *_TAB_MODIFICATIONS to decide on the eligible candidates.
In 12c, Oracle has done away with most of these and provides only GATHER and GATHER AUTO