SQL/MX 2.x Installation and Management Guide (G06.24+, H06.03+)

Managing Database Applications
HP NonStop SQL/MX Installation and Management Guide523723-004
11- 4
Moving a Program Without Compiled Modules
The similarity check determines if the query execution plan of a statement is still
operable. If the similarity check fails (or is disabled), the SQL/MX executor, by default,
invokes the SQL/MX compiler to automatically recompile the query execution plan. The
automatically compiled plan is not saved for subsequent executions of the same
program or for multiple concurrent executions of the same program. Therefore,
automatic recompilation is costly in terms of performance. For more information, see
the SQL/MX Programming Manual for C and COBOL and the SQL/MX Programming
Manual for Java.
To pass the similarity check and avoid automatic recompilation, the production
database must be structurally identical to the development database. The tables on the
production system must have the same index definition, number of partitions, partition
boundaries, table attributes, and column names, numbers, and data types as the
tables on the development system. In addition, the presence of identical unique
indexes in SELECT statements, views, or check or referential integrity constraints in
compared tables causes similarity check failure and automatic recompilation. For more
information, see the similarity check criteria in the SQL/MX Programming Manual for C
and COBOL and the SQL/MX Programming Manual for Java.
Even if the similarity check passes, there are other reasons not to use query execution
plans from a development system on a production system:
The cost of the similarity check on a table increases with the size and complexity of
the table. It is not always advisable to incur the cost of similarity checks at the
startup of every process that uses the plan.
If you fail to properly set up all DEFINEs for SQL/MP tables and the development
and production systems are on the same Expand network, the wrong tables might
be accessed.
Moving a Program Without Compiled Modules
You can move a program from a development system to a production system and then
compile module definitions (either embedded module definitions or module definition
files) on the production system.
Considerations
Before choosing this approach for moving the program files, consider:
Query Execution Plan on page 11-4
Default Settings on page 11-5
Name Resolution on page 11-5
Query Execution Plan
The SQL/MX compiler might produce plans on the production system that differ
significantly from those on the development system. Possible causes include: