Identifying missing or conflicting statistics
During access path selection, Db2 identifies statistics values that are missing or conflicting. Db2 externalizes data about the missing or conflicting statistics in certain catalog and EXPLAIN tables.
Before you begin
- Activate the collection of statistics feedback data. For details, see Controlling the collection of statistics feedback.
- Consider using a query optimization tool to analyze and apply the optimization feedback.
About this task
- The DSN_STAT_FEEDBACK table, when you capture access path information in EXPLAIN tables. Information is captured in this table only when Db2 uses the access path selection process to capture the EXPLAIN information. The access path selection process is not used when you issue an EXPLAIN statement with the STMTCACHE or PACKAGE options.
- The SYSIBM.SYSSTATFEEDBACK catalog table, at the specified statistics interval.
Each statistics feedback row indicates that a statistic that Db2 uses during access path selection was not available or was in conflict with other statistics. Because the statistics values are not checked, a statistics feedback row does not indicate certainty that collecting the statistic can change or improve the access path.
You can analyze the feedback data and collect the missing or conflicting statistics. Optimization tools can also use the optimization feedback data to recommend the collection of such statistics.
Procedure
To apply statistics feedback: