Availability Guide for Application Design
Designing Applications for Change
Availability Guide for Application Design—525637-004
10-32
Physically Reconfiguring the Database
execution plans that pass the similarity check might not execute as efficiently as
those that are recompiled for their new objects.
The COMPILE PROGRAM option has an optional STORE SIMILARITY INFO clause
that causes similarity information to be saved for future compilations. The COMPILE
INVALID PLANS and COMPILE INOPERABLE PLANS options can work only if
COMPILE PROGRAM STORE SIMILARITY INFO was specified when the program
was previously compiled.
Similarity Checks With Automatic Recompilation
Automatic recompilation is done at run time rather than at compile time and avoids
static recompilation. Automatic recompilation, however, does not permanently update
the execution plans. Therefore, automatic recompilation must take place every time the
program is run. Where automatic recompilation is necessary, you can expect
application startup to be less efficient than when automatic recompilation is not used.
As with static recompilation, there is a corresponding choice of compiler options:
•
Automatically recompile all SQL statements in the program (the default) using the
CHECK INVALID PROGRAM option.
This option causes automatic recompilation of every SQL statement in the program
if the program refers to any changed object. All execution plans are fully optimized.
•
Automatically recompile invalid execution plans using the CHECK INVALID PLANS
option.
This option causes automatic recompilation of only the SQL statements that make
use of SQL objects that have changed. All execution plans are again fully
optimized.
•
Automatically recompile inoperable execution plans using the CHECK
INOPERABLE PLANS option.
This option causes automatic recompilation of only the SQL statements that failed
the similarity checks. Although some aspect of an SQL object has changed, the
new object is sufficiently similar to the original object that the same execution plans
still work. However, execution plans that pass the similarity check might not
execute as efficiently as those that are automatically recompiled for their new
objects.
These CHECK options are compiler options that must have been used when the SQL
compiler was last used to compile the entire program.
Caution. This option can cause severe performance problems if many SQL programs must be
automatically recompiled concurrently. Suppose you have 100 SQL processes running on one
processor. If that processor fails, then 100 automatic recompilations would begin on other
processors in the system, having an effect on performance severe enough to threaten
availability.