Introduction to NonStop SQL/MP
Parallel Execution
NonStop SQL Architecture
3–16 113425 Tandem Computers Incorporated
The Master Executor and
ESPs
To implement parallel execution of a query, NonStop SQL/MP uses a master executor
process, which starts the query execution. The master executor invokes multiple
executor server processes (ESPs), assigning one ESP to each partition that must be
accessed. The ESPs process a statement or part of a statement in parallel, performing
the data access against their respective partitions and returning data or status
information to the master executor. The master executor then processes that
information and returns the result to the user.
Suppose you want to know the total number of employees in your company. You can
issue the following query:
SELECT COUNT(*)
FROM EMPLOYEE ;
The query uses an aggregate function called COUNT to count the number of rows in
the EMPLOYEE table. (You can use other aggregate functions to compute the sum of
values in a column or the average, minimum, or maximum value in a column.)
Suppose that the EMPLOYEE table has four partitions. Because the preceding query
scans the entire table, it is a good candidate for parallel query execution.
Figure 3-7 shows how a master executor assigns four ESPs to manage the execution of
the COUNT operation against the four partitions of the EMPLOYEE table. At run
time, the master executor starts an ESP (or uses an existing ESP) in the current primary
processor of each partition's disk volume. Each ESP directs the data access manager
associated with its partition to count the rows in that partition and compute the partial
aggregate result. The data access managers return the partial results to the ESPs,
which pass them to the master executor. The master executor uses the SUM function
to add up the partial COUNTs and returns the final result to the user.
Figure 3-7 shows a simple example of parallel query execution. ESPs can also perform
more complex operations such as parallel joins.