Managing query access paths
The access paths that Db2 uses to process SQL statements are among most important aspects of query performance.
About this task
The access path for an SQL statement specifies how Db2 accesses the data that the query specifies. It specifies the indexes and tables that are accessed, the access methods that are used, and the order in which objects are accessed.
Db2 selects the access paths for most static SQL statements when application program is bound or rebound into a package. However, access paths for some statements, such as statements that contain variable values and parameter markers, must be selected at run time. Db2 selects the access paths for dynamic SQL statements when the statements are issued.
To select efficient access paths, Db2 relies on the following elements:
- Queries that use effective predicates.
- Indexes that support efficient data access.
- Statistics that describe the data sufficiently and accurately.
Theses elements are among the foundations good query performance. It is best to verify them before you try to apply special methods to influence access path selection.
Procedure
To manage query access paths: