SQL/MX 3.x Query Guide (H06.22+, J06.11+)

HP NonStop SQL/MX Query Guide640323-001
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-19
Overview
At the highest level, compiling and executing an SQL query with NonStop SQL/MX
consists of two basic steps.
1. The SQL/MX compiler processes the query and produces a query execution plan.
2. The SQL 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 CONTROL QUERY DEFAULTS statement
Keeping statistics current with the UPDATE STATISTICS statement
Changing system default settings in the SYSTEM_DEFAULTS table
VST110.vsd
System
Defaults
Control
Query
Defaults
Control
Query
Shape
Statistics
(histograms)
Metadata
QUERY
QUERY
Query
Execution Plan
Query
Execution Plan
SQL/MX COMPILER
Query
Execution Plan
SQL/MX EXECUTOR
VST120.vsd
Result