Managing and preventing access path change

Start of changeYou can prevent unwanted access path changes for critical applications when you rebind applications that contain static SQL statements and when DB2® prepares dynamic SQL statements.End of change

About this task

Begin program-specific programming interface information.

Query optimization depends on many factors, and even minor changes in the database environment might cause significant changes to access paths. DB2 uses the statistics that are stored in the DB2 catalog to determine the most efficient access paths during the bind process. When you reorganize your data, collect statistics, and rebind your packages or plans, DB2 can choose the most efficient access paths for your queries.

Because DB2 must often rely on incomplete information, such as statistics, suboptimal access paths are possible. Reoptimization sometimes yields access paths that cause performance regressions, including unnecessary I/O operations and excessive processor consumption, and even application outages.

DB2 also considers the following system and subsystem attributes during access path selection:

  • Central processor model
  • The number of central processors (for determining the appropriate degree of parallelism.)
  • Buffer pool size, and other statistics
  • RID pool size

These factors can change access paths for a statement from one system to another, even if all the catalog statistics are identical. So, you must account for these factors when you model your production systems on test systems, and when you model new applications. Mixed central processor models in a data sharing group might also affect access path selection.

End program-specific programming interface information.