SQL/MX 2.x Reference Manual (H06.04+)

SQL/MX Statements
HP NonStop SQL/MX Reference Manual—540440-003
2-35
CONTROL QUERY SHAPE Statement
CONTROL QUERY SHAPE Statement
Considerations for CONTROL QUERY SHAPE
Examples of CONTROL QUERY SHAPE
The CONTROL QUERY SHAPE statement forces access plans. You can generate the
result of the EXPLAIN function for a prepared DML statement, and then modify the
operator tree for the statement’s access plan, by using CONTROL QUERY SHAPE.
Both the EXPLAIN function and the CONTROL QUERY SHAPE statement use similar
identifiers for the nodes of an operator tree.
CONTROL QUERY SHAPE is an SQL/MX extension:
CONTROL QUERY SHAPE [ query-shape-options ] shape
query-shape-options is:
{IMPLICIT { SORT | EXCHANGE | EXCHANGE_AND_SORT }}
shape is:
{CUT | ANYTHING | OFF}
| TUPLE
| join-shape(shape,shape [,{TYPE1 | TYPE2}]
[,num-of-esps]) | INDEXJOIN
| exchange-shape(shape [,num-of-esps])
| {SCAN | FILE_SCAN | INDEX_SCAN} [(scan-option,...)]
| UNION(shape,shape)
| GROUPBY(shape)
| SORT_GROUPBY(shape)
| HASH_GROUPBY(shape)
| SHORTCUT_GROUPBY(shape)
| EXPR(shape)
| SORT(shape)
| MATERIALIZE(shape)
| [{PACK | UNPACK }] (shape)
join-shape is:
JOIN
| NESTED_JOIN
| MERGE_JOIN
| HASH_JOIN
| HYBRID_HASH_JOIN
| ORDERED_HASH_JOIN
exchange-shape is:
EXCHANGE
| PARTITION_ACCESS
| SPLIT_TOP_PA
| ESP_EXCHANGE