Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Interpreting HASH JOIN in Oracle query plan

When I see something like this in an Oracle query plan:

HASH JOIN
    TABLE1
    TABLE2

Which of these two tables is being hashed?

The Oracle documentation refers to a "smaller" table usually being hashed, but is there a guarantee that the hashed table will always be in a particular position (either top or bottom sub-node) when displayed inside a query plan?

like image 313
Branko Dimitrijevic Avatar asked Jul 19 '14 00:07

Branko Dimitrijevic


1 Answers

Example 9-3 Hash Joins, in the JOIN documentation, concerns an explain plan for hash joins. There is a sentence under the example which states:

In a hash join, the data set for the hash table always appears first in the list of operations (Step 2).

One remark; Oracle doesn't hash a smaller table, but a smaller dataset.

like image 100
krokodilko Avatar answered Oct 29 '22 18:10

krokodilko