Saving and switching to previous access paths

You can save information about the previous access paths when you use a REBIND command to rebind your packages. When a new access path results in a performance regression, you can switch back to the previous access path.

About this task

When you specify a plan management policy, Db2 saves access path information for SQL statements when you issue REBIND PACKAGE or REBIND TRIGGER PACKAGE commands. When an access path change results in a performance regression, you can specify the SWITCH option and rebind the package again to revert to the previous access paths.

You can specify the following plan management policies:

EXTENDED

Db2 saves the active copy, and two older copies, which are known as the previous and original copies. Db2 replaces the previous copy with the former active copy and saves the newest copy as the active copy. Db2 saves the original copy at the first rebind that EXTENDED is specified and retains the original copy unchanged at subsequent rebinds.

FL 505 Multiple phased-out copies can also be saved for phase-in of package rebinds. For more information, see Phase-in of package rebinds.

EXTENDED is the default value.

BASIC
Db2 saves the active copy and one older copy, which is known as the previous copy. Db2 replaces the previous copy path with the former active copy and saves the newest copy the active copy.
OFF
No copies are saved.
Tip: Use the default option EXTENDED in most cases.

You can specify the plan management policy for a package by specifying the PLANMGMT option. If you omit the PLANMGMT option, Db2 uses the PLANMGMT subsystem parameter setting.

Use the EXTENDED plan management policy whenever you rebind packages with the APREUSE(WARN) or APCOMPARE(WARN) option. This approach enables you to revert the package to use the previous access paths when you detect access path changes that you do not want.