Collecting statistics by using statistics profiles

You can use statistics profiles to invoke the RUNSTATS utility with a predefined set of statistics collection options. Db2 also uses statistics profiles when you enable autonomic statistics maintenance.

Procedure

To collect statistics by using a statistics profile, use any of the following methods:

  • Issue the following RUNSTATS control statement:
    RUNSTATS TABLESPACE ts-name TABLE table-name USE PROFILE
  • Specify the STATISTICS option and the USE PROFILE option when you run any of the following utilities:
    • LOAD
    • REORG TABLESPACE

Results

Db2 collects statistics for the table specified by table-name according to the collection options that are specified in the profile, and issues a message to indicate that the profile was used.

The utility also deletes any existing statistics for the specified object that are not included in the profile.

If no profile exists for a target table, a default is used for the profile specification:
  • If no table name is specified, TABLE ALL INDEX ALL is used.
  • If a table name is specified, COLUMN ALL INDEX ALL is used.