SQL/MX 2.x Query Guide (H06.04+, J06.03+)
SQL/MX Operators
HP NonStop SQL/MX Query Guide—540437-005
7-20
FirstN Operator
FirstN Operator
The FirstN operator describes a portion of execution plan that selects only first few
rows of output. This operator has only one child node. The description field for this
operator contains:
The example for FirstN operator is based on:
PREPARE TestQuery6 FROM
SELECT [FIRST 100] s_acctbal, s_name, n_name, p_partkey, p_mfgr,
s_address, s_phone, s_comment
FROM part,supplier,partsupp, nation, region
WHERE p_partkey = ps_partkey
AND s_suppkey = ps_suppkey
AND p_size = 15
AND p_type like '%BRASS'
AND s_nationkey = n_nationkey
AND n_regionkey = r_regionkey
AND r_name = 'EUROPE'
AND ps_supplycost = (SELECT MIN(ps_supplycost)
FROM partsupp, supplier, nation, region
WHERE p_partkey = ps_partkey
AND s_suppkey = ps_suppkey
AND s_nationkey = n_nationkey
AND n_regionkey = r_regionkey
AND r_name = 'EUROPE')
ORDER BY s_acctbal desc, n_name, s_name, p_partkey;
DESCRIPTION
fragment_id ............ 0
parent_frag ............ (none)
fragment_type ............ master
HASH_GROUPBY Operator
Groupby Group
The HASH_GROUPBY operator describes a portion of an execution plan that affects a
group. The group values are computed by hashing individual rows into a hash table.
When a new row is received, the executor hashes to the hash table and performs the
aggregate in the hash table.
Token Followed by ... Data Type
fragment_id A sequential number assigned to the fragment.
0 is always the master executor and 1 is
reserved for the EXPLAIN plan. Numbers 2 to
n will be ESP or DAM fragments.
integer
parent_frag The fragment_id for the parent fragment of the
current fragment. The value is (none) for the
master executor.
Integer
fragment_type Master, ESP, or DP2. text










