SQL/MX 2.x Query Guide (G06.24+, H06.03+)

HP NonStop SQL/MX Query Guide523728-003
1-1
1
Compiling and Executing a Query
Use the information in this section to understand how your queries are compiled and
executed.
How the Compiler Works on page 1-2
How the Executor Processes the Plan on page 1-14
Overview
At the highest level, compiling and executing an SQL query with SQL/MX consists of
two basic steps.
1. The SQL compiler processes the query and produces a query execution plan.
2. The executor processes the execution plan and produces the query result.
These actions can influence query optimization, as shown in Step 1:
Forcing plans with the CONTROL QUERY SHAPE statement
Changing default settings with the SYSTEM_DEFAULTS Table
Keeping statistics current with the UPDATE STATISTICS statement
CONTROL QUERY SHAPE
statement
QUERY
Query
Execution Plan
SQL COMPILER
SYSTEM_DEFAULTS
table
Metadata
(including statistics)
VST110.vsd
Query
Execution Plan
SQL EXECUTOR
VST120.vsd
Result