Collecting Statistics

RUNSTATS avoidance
Traditionally it was common to collect statistics from time to time to ensure the Db2 optimizer has the most current statistics required to choose the best access path for better performance. However, collecting statistics blindly may be expensive if the data has not changed dramatically or has not grown. Real Time Statistics can be used to identify the rate of changes since the last RUNSTATS. In addition, with RTS you may no longer rely on catalog statistics to identify which objects require REORG and you can afford to collect statistics only for the usage of the Db2 optimizer.

Rebinding packages
Packages must be rebound to allow the Db2 optimizer to reselect an access path based on the most recent statistics. Often administrators are concerned about performance degradation due to bad selection of access path caused by poor statistics. Db2 programs access multiple tables and therefore it is important that we have good statistics for all referenced tables. One way to ensure we have good statistics is to rebind packages following REORG collecting inline statistics.

Rebinding packages might fail because of bind errors. Capturing these errors and allowing the job step to complete normally, allows better operability of utility jobs including rebind steps. The errors can be stored in a repository of errors that allows later examination or automatic handling. The list of packages may include obsolete packages that fail to rebind because tables were altered or dropped. These packages can be dropped.