Gathering statistics with the COPY RUNSTATS option
The RUNSTATS option on the COPY command allows you to gather table space level statistics and update the Db2 catalog.
These statistics can be used to determine when to take table space level actions such as reorganizations. Statistics are also used by the Db2 optimizer for access path selection. Thus,
allows you to accomplish two tasks--making an image copy and gathering statistics--with one pass of the data. This capability provides significant performance and resource savings over running a COPY utility and a RUNSTATS utility separately and is unique to
. For more information, see RUNSTATS and Reducing elapsed time.
BMCSTATS can also be updated if you have DASD MANAGER PLUS.
Set the INVCACHE option (OPTIONS-syntax-option-description and INVCACHE=NO) to YES if you need to have the dynamic SQL cache invalidated after the statistics are updated. Using INVCACHE=YES will cause the Db2 optimizer to pick up the new information the next time the SQL statement is executed.
Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*