SQL/MX 2.x Reference Manual (G06.24+, H06.03+)

SQL/MX Functions and Expressions
HP NonStop SQL/MX Reference Manual523725-004
9-57
Considerations for EXPLAIN
Using EXPLAIN and DISPLAY_EXPLAIN
The result of the EXPLAIN function for a specific DML statement can be generated
either by using the EXPLAIN function or the DISPLAY_EXPLAIN command. Use the
EXPLAIN function only for prepared statements.
The DISPLAY_EXPLAIN command displays all the columns of the result table of the
EXPLAIN function. If you want to display only some of the columns, you must use the
EXPLAIN function to return the intermediate result table that you then query with a
SELECT statement.
Result of the EXPLAIN Function
The result table of the EXPLAIN function describes the access plans for SELECT,
INSERT, DELETE, UPDATE, or CALL statements. Use the EXPLAIN function to
generate the result and the DISPLAY_EXPLAIN command to display the result.
See the EXPLAIN Function on page 9-55 and DISPLAY_EXPLAIN Command on
page 4-13.
In this description of the result of the EXPLAIN function, an operator tree is a structure
that represents operators used in an access plan as nodes, with at most one parent
node for each node in the tree, and with only one root node.
A node of an operator tree is a point in the tree that represents an event (involving an
operator) in a plan. Each node might have subordinate nodes—that is, each event
might generate a subordinate event or events in the plan.
Column Name Data Type Description
MODULE_NAME CHAR(60) Module name as specified in the argument to the EXPLAIN
function; if NULL, the name of the current module.
STATEMENT_
NAME
CHAR(60) Statement name after wild-card character expansion;
truncated on the right if longer than 60 characters.
PLAN_ID LARGEINT Unique system-generated plan ID automatically assigned
by NonStop SQL/MX; generated at compile time.
SEQ_NUM INT Sequence number of the current node in the operator tree;
indicates the sequence in which the operator tree is
generated.