SQL/MX 2.x Query Guide (G06.24+, H06.03+)
Operators and Operator Groups
HP NonStop SQL/MX Query Guide—523728-003
7-47
SORT_PARTIAL_GROUPBY_LEAF Operator
SORT_PARTIAL_GROUPBY_LEAF Operator
Groupby Group
The SORT_PARTIAL_GROUPBY_LEAF operator executes a partial group by as close
to where the data is read as is cost effective. This strategy reduces the amount of data
that must be redistributed for a query. The operator must always be accompanied by a
SORT_PARTIAL_GROUPBY_ROOT operator above it in the tree, which finalizes the
query.
The SORT_PARTIAL_GROUPBY_LEAF operator has one child node. The description
field for this operator contains:
The example of the SORT_PARTIAL_GROUPBY_LEAF operator is based on:
SELECT a.ten, MAX(a.unique2)
FROM $big18a.wisc32m.abase a, $big18a.wisc32m.bbase b
WHERE a.unique2=b.unique2 AND a.fiftypercent = 1
GROUP BY a.ten ORDER BY a.ten;
6 . 7 sort_partial_groupby_leaf
grouping_columns: indexcol(\TESTSYS.$BIG18A.WISC32M.ABASE.TEN)
aggregates: max(indexcol(\TESTSYS.$BIG18A.WISC32M.ABASE.UNIQUE2)
SORT_PARTIAL_GROUPBY_ROOT Operator
Groupby Group
The SORT_PARTIAL_GROUPBY_ROOT operator works together as a pair with the
SORT_PARTIAL_GROUPBY_LEAF operator. The
SORT_PARTIAL_GROUPBY_ROOT operator finalizes the group by at the ESP level.
The SORT_PARTIAL_GROUPBY_ROOT operator has one child node. The
description field for this operator contains:
Token Followed by... Data Type
grouping_columns Expression of the
grouping columns
expr(text)
aggregates Expression of the
aggregate functions
expr(text)
Token Followed by ... Data Type
aggregates Expression of the aggregate
functions
expr(text)
selection_predicate Expression of the having
clause
expr(text)
grouping_columns Expression of the grouping
columns
expr(text)