SQL/MX 2.x Reference Manual (H06.10+, J06.03+)
SQL/MX Statements
HP NonStop SQL/MX Reference Manual—544517-008
2-38
CONTROL QUERY SHAPE Statement
statement can still contain additional enforcer nodes, and the compiler will
enforce such nodes. Note that WITHOUT ENFORCERS does not mean that
the statement or the generated plans are free of enforcer nodes.
shape
specifies the operator tree for an access plan for the next query to be executed
within the current session. shape defines this operator tree recursively by using a
LISP-like expression to represent the nodes of the tree.
The identifiers for the nodes specified by shape:
CUT
ANYTHING
OFF
Replaces a node in operator tree. CUT (or ANYTHING or
OFF) represents the point (node) at which you want to cut off
the remaining part of the operator tree.
TUPLE Replaces a single VALUES node in operator tree.
UNION Replaces a UNION node in operator tree.
MultiUnion MultiUnion is the first n-ary operator that is supported in a
Control Query Shape (CQS). MultiUnion is applicable only
for the UNION ALL operator and not for the ANSI UNION
operator.
You can specify a shape for MultiUnion children in one of
the following ways:
1. Allow a single wild card shape for all the children. All
children are assumed to look alike.
2. Allow multiple wild card shape for children. A group of
children conform to one set of shape, the rest to
another.
3. Specify a shape for each MultiUnion child completely.
If the third alternative is implemented—that is if a MultiUnion
has N children, all the N children must be specified in the
shape. The children must not be excluded. Any attempt to
match a MultiUnion with different arity will result in a
violation of the shape specification. However, the generic
wild-card operator cut can be used as a replacement for
any of the children of the MultiUnion. For example:
MultiUnion(cut,
Nested_Join(cut,cut),cut);
GROUPBY Replaces a GROUP BY or AGGREGATE (set) operation
node in operator tree.
SORT_GROUPBY Replaces a SORT GROUP BY or AGGREGATE (set)
operation node in operator tree.
HASH_GROUPBY(cut)
or HG (cut)
Replaces a HASH GROUP BY node in operator tree.










