Program Invalidation and Automatic SQL
Recompilation
HP NonStop SQL/MP Programming Manual for C—429847-008
8-12
Preventing Automatic Recompilations
INOPERABLE PLANS option. Otherwise, the similarity check fails, and automatic
recompilation occurs.
RUN-TIME-TABLE can be the same table as COMPILE-TIME-TABLE, a modified
version of COMPILE-TIME-TABLE, or a different table altogether.
For RUN-TIME-TABLE to be similar to COMPILE-TIME-TABLE, all characteristics and
attributes must be the same, except for these allowable differences:
ï‚·
Names of the tables
ï‚·
Contents of the tables (that is, the data in the table)
ï‚·
Partitioning attributes (number of partitions and partitioning key ranges)
ï‚·
Number of indexes–RUN-TIME-TABLE must have all indexes used by
COMPILE-TIME-TABLE in the execution plan. RUN-TIME-TABLE can also have
additional indexes that COMPILE-TIME-TABLE does not have.
COMPILE-TIME-TABLE can have indexes that RUN-TIME-TABLE does not have
but only if the execution plan does not use the additional indexes.
ï‚·
Key tags (or values) for indexes
ï‚·
Creation timestamp and redefinition timestamp
ï‚·
AUDIT attribute–However, if a statement performs a DELETE or UPDATE set
operation on a nonaudited table that has a SYNCDEPTH of 1, the SQL executor
returns an error and forces the automatic recompilation of the statement (if
NORECOMPILE is not specified).
ï‚·
Any of these file attributes:
ï‚·
Statistics on the tables
ï‚·
Column headings
ï‚·
Comments on columns, constraints, indexes, or tables
ï‚·
Catalog where the table is registered
ï‚·
Help text
ï‚·
Number of columns–RUN-TIME-TABLE can have more columns than
COMPILE-TIME-TABLE, but the common columns of both tables must have
Note. The similarity check does not support parallel execution plans. Tables are not
considered similar if they are specified in a query that uses a parallel execution plan.
ALLOCATE LOCKLENGTH SECURE
AUDITCOMPRESS MAXEXTENTS SERIALWRITES
BUFFERED NOPURGEUNTIL TABLECODE
CLEARONPURGE OWNER VERIFIEDWRITES
EXTENT (primary and secondary)