SQL/MP Installation and Management Guide

Managing Database Applications
HP NonStop SQL/MP Installation and Management Guide523353-004
10-10
Automatic Recompilation
NORECOMPILE, the only way to revalidate the program is to explicitly SQL
compile it again. By using NORECOMPILE, you ensure that:
°
All programs use the best query execution plan to enhance performance.
°
Alterations to the database, object moves, or errors in the DEFINE setup
cannot inadvertently affect the production environment.
If you specify RECOMPILE, determine the extent of recompilation that is best for your
application. Use the SQL compiler RECOMPILEALL or RECOMPILEONDEMAND
option that causes the least overhead for the recompilations:
RECOMPILEALL specifies that if the program becomes invalid, the entire program
is automatically recompiled before execution continues. After being automatically
recompiled, the program is executed as any valid program. This option is the
default.
RECOMPILEONDEMAND specifies that if the program becomes invalid, only the
statements actually executed are automatically recompiled. Recompilation occurs
on the first execution of each invalid statement. This option can save system
resources if the server has a number of unexecuted SQL statements.
PATHMON DEFINEs and SQL Recompilation
Setting DEFINE names in the PATHMON configuration file does not change DEFINEs
that were in effect when a server was SQL compiled.
After a program has been SQL compiled using a specified DEFINE set, the program is
valid only for those objects in that set. Changing the DEFINE set in the PATHMON
configuration file triggers an automatic recompilation at run time if the DEFINE set is
different from that used at compilation time.
If no DEFINEs are set within the configuration file for the server class, the server uses
the DEFINE set that was valid during the last explicit SQL compilation.
While it is always advantageous to run valid SQL programs (programs that do not
recompile at run time), setting the DEFINE set within the configuration ensures that all
programs use the proper DEFINE set, regardless of the last explicit SQL compilation.
The DEFINE set within the PATHMON configuration for the server class and the
DEFINE set used at compilation should be identical.
If an SQL program is explicitly SQL recompiled while the previously generated object
program is running, a ZZBInnnn file is produced. The object program currently in use is
renamed ZZBInnnn, and the newly compiled program becomes the named program.
The PATHMON process continues to use the ZZBInnnn program for the servers that
are presently in run state. New server programs started by the PATHMON process,
however, will use the newly compiled program.
If the object program is a native application (code 700), the currently in use program
file is renamed as ZZNDnnnn instead of ZZBInnnn. Here nnnn denotes a random four
digit number.