SQL/MP Installation and Management Guide
Managing Database Applications
HP NonStop SQL/MP Installation and Management Guide—523353-004
10-7
Automatic Recompilation
•
The program file is registered in the catalog. This operation includes storing a
description of the program in the PROGRAMS catalog table and storing usage
dependencies in the USAGES tables of the catalogs in which objects referred to by
this program are described.
•
Explicit compilation produces an object program that can be executed without first
being automatically recompiled. To avoid the overhead of automatic recompilation,
you must ensure that programs are valid as described under Determining Validity
of a Program on page 10-4.
•
If similarity checking is enabled by using the CHECK INOPERABLE PLANS option,
certain types of run-time recompilations can be minimized or avoided (described in
the next subsection).
Automatic Recompilation
Automatic recompilation is the SQL recompilation, in memory, of a program or SQL
statement. The recompilation is invoked automatically by the SQL executor at run time.
The RECOMPILE option (described later in this subsection) is required during the
explicit SQL compilation if you want to enable subsequent automatic recompilation for
the program. The extent of recompilation depends on whether the RECOMPILEALL or
RECOMPILEONDEMAND compiler option is used for explicit compilation.
Automatic recompilation can occur in these situations:
•
A program file is marked as invalid. The SQL compiler CHECK option (described
under Using Similarity Checks on page 10-15) determines the extent of
recompilation. Similarity checking can avoid or minimize recompilation.
•
DEFINEs at run time are different from the values of the DEFINEs in effect at
explicit compilation time. The SQL compiler CHECK option determines the extent
of recompilation.
•
An event occurs during execution that changes the definition of an object used by
a program. (The executor determines that the RECOMPILATION timestamp in the
program file label represents a time that is earlier than the redefinition timestamp of
a dependent SQL object.)
•
Some objects required for the query execution plan are not available at run time.
The objects could be local or remote tables, views, or indexes.
•
RECOMPILEONDEMAND is selected, and an attempt is made to run an invalid
statement.
•
The access path used by the plan is not available. If an index is not available, the
executor can recompile the plan to use the primary access path.
•
The program was compiled with the FORCE option, and some statements had
errors; the statements with errors are automatically recompiled.