SQL/MX Comparison Guide for SQL/MP Users

Optimizer and Executor
HP NonStop SQL/MX Comparison Guide for SQL/MP Users523735-003
5-5
SQL/MX Task Model
SQL/MX Task Model
NonStop SQL/MX uses a data flow and scheduler-driven task model to execute
queries. After a query is optimized, the optimizer generates an optimized, executable
query plan that goes to the executor. The executor creates an operator tree based on
the executable query plan and prepares a node for each operator.
The next figure shows an operator tree in the task model. Each operator is an
independent task, and data flows between operators through in-memory queues or by
interprocess communication. The queue pair operates between two operators. Queues
between tasks allow operators to exchange multiple requests or result rows at a time.
A scheduler coordinates the execution of tasks and runs whenever it has data on one
of its input queues.
Building on the previous figure, the next figure shows the steps that the executor might
take to process this simplified query tree. The numbers in the figure relate to the
operations:
1. The join places a request in the down queue of the left scan.
2. The scan places a group of rows in its up queue, which the join retrieves.
3. The join places a request in the down queue of the right scan. At the same time,
the join can place a request in the down queue of the left scan.
4. The right scan places a group of rows in its up queue, which the join retrieves. If
active, the left scan also places a group of rows in its up queue, which the join
retrieves.
Nested Join
Function call
for scan to
DAM
Scan B
Scan A
1
2
3
4
5
6
7
8
Function call
for scan to
DAM
Join
Scan
Tasks
Queues
Scan