SQL/MX 2.x Query Guide (G06.24+, H06.03+)

Operators and Operator Groups
HP NonStop SQL/MX Query Guide523728-003
7-35
ORDERED_HASH_JOIN Operator
anti-semi join_method: hash
ORDERED_HASH_JOIN Operator
Join Group
The ORDERED_HASH_JOIN operator joins the data from two child tables. This
operator preserves the order of the outer table and does not overflow to disk. It creates
a hash table from the inner table, joins the outer table by hashing each outer row, and
looks for matches in the hash table. The reuse feature enables reuse of the hash table
for subsequent requests within the same query. Choose this operator when you need
to preserve the order of the outer table or if you can benefit from the reuse feature. It
should be chosen only if the inner table is small enough to fit in memory.
Equijoins and cross-products are supported by this operator.
The ORDERED_HASH_JOIN operator has two child nodes. The description field for
this operator contains:
The difference between join_predicate and hash_join_predicate tokens is that the
former are the non-equijoin predicates, while the latter are equijoin predicates that are
used to help build and probe the hash table.
The example of the ORDERED_HASH_JOIN operator is based on:
SELECT * FROM customer JOIN nation on c_nationkey = n_nationkey
WHERE c_custkey > 10000
AND c_custkey < 10010 ORDER BY c_custkey>
? XX
211932229204655082 6 ORDERED_HASH_JOIN
5 2
Token Followed by ... Data Type
hash_join_predicate Expression of the join
predicates
expr(text)
join_type Inner, left, natural, inner semi,
or inner anti-semi-join
text
join_method Name of join method text
join_predicate Expression of the join
predicates
expr(text)
parallel_join_type Type1 or Type2, depending on
parallel join algorithm
text
reuse_comparison_values List of values that cause the
hash table to be rebuilt when
values change
expr(text)
selection_predicates Expression of the selection
predicates
expr(text)