SQL/MP Programming Manual for COBOL

Program Invalidation and Automatic SQL
Recompilation
HP NonStop SQL/MP Programming Manual for COBOL529758-003
8-8
Causes of Automatic Recompilation
Unavailable Access Path (Index)
If the SQL executor encounters an unavailable access path (index) in the execution
plan of an SQL statement, the SQL executor invokes the SQL compiler to recompile
the statement. The SQL compiler then determines the best alternate access path, if
such a path exists, to execute the statement. The SQL compiler recompiles only the
affected SQL statement when an access path is unavailable.
Uncompiled SQL Statement
If the SQL executor encounters an uncompiled SQL statement, it invokes the SQL
compiler to compile the statement. An SQL program file can contain an uncompiled
SQL statement in these cases:
The SQL statement referenced an SQL object that did not exist or was unavailable
during explicit SQL compilation.
The SQL statement referenced a DEFINE that did not exist during explicit
SQL compilation.
The program was explicitly compiled with the SQLCOMP FORCE option, and the
SQL statement generated an error.
Figure 8-1. Timestamp Check
Processor (CPU) Memory
SQL Executor Object
Code
. . .
PROG Execution Plans
. . .
SELECT ... FROM TAB ...
SQL Executor compares
TAB timestamps in
PROG execution plan
and in TAB file label.
SQL recompilation rewrites copy of
PROG execution plan in memory only.
PROG
(object code)
NonStop
SQL/MP
Database
PROG Execution Plans
. . .
SELECT ... FROM TAB ...
TAB Redefinition Timestamp
. . .
TAB Data
TAB File Label
Redefinition Timestamp
. . .
Timestamp Check
VST005.vsd