SQL/MX 2.x Query Guide (G06.24+, H06.03+)
Operators and Operator Groups
HP NonStop SQL/MX Query Guide—523728-003
7-45
SORT_PARTIAL_AGGR_LEAF Operator
The SORT_GROUPBY operator has one child node. The description field for this 
operator contains:
The example of the SORT_GROUPBY operator is based on:
SELECT o_orderpriority, COUNT(*) as order_count
FROM orders
WHERE o_orderdate >= DATE '1993-07-01'
 AND o_orderdate < DATE '1993-07-01' + INTERVAL '3' MONTH
 AND EXISTS (SELECT *
 FROM lineitem
 WHERE l_orderkey = o_orderkey
 AND l_commitdate < l_receiptdate)
GROUP BY o_orderpriority
ORDER BY o_orderpriority;
?                                                             XX                                                              
211862597502233318    9 SORT_GROUPBY           
8   ?   
3.7025923E+000 7.7009797E-005 1.9430620E+000 CPU_TIME: 
9.52407e-05 IO_TIME: 0 MSG_TIME: 0 IDLETIME: 0 
PROBES: 1                                                                                                                                        
grouping_columns: 
indexcol(\TESTSYS.$DATA14.SPTPCD.ORDERS.O_ORDERPRIORITY) 
aggregates: count(1 )
SORT_PARTIAL_AGGR_LEAF Operator
Groupby Group
The SORT_PARTIAL_AGGR_LEAF operator executes a partial group by operation 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_AGGR_ROOT operator above it in the tree, which 
finalizes the query.
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)










