Automated statistics profiles

Db2 12 introduces the capability for Db2 to manage which statistics to collect based on the queries running on the system.

The Db2 cost-based optimizer relies on statistics about tables and indexes. Prior to Db2 12, it was often the case that only standard or default statistics were gathered, which meant that queries might not perform as well as possible. It was sometimes difficult to know which statistics should be gathered, due to the number of SQL statements, tables, indexes, columns, and keys.

Db2 12 introduces the automatic updating of statistics profiles based on recommendations generated during query optimization, so that RUNSTATS collects all of the statistics recommended by the optimizer.

FL 507 Beginning in function level 507, when statistics are collection with the RUNSTATS TABLESPACE, REORG TABLESPACE, or LOAD utilities with the USEPROFILE option, the utility also deletes any existing statistics that are not included in the profile.