Hey guys,
Can any one explain what is Hash inner join and how it differs from regular inner join?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Manikandan MurugesanPosted Sep 6, 2017, 9:08 PM
Just to comment on what a HASH join is. There are basically three types of join - HASH, MERGE and LOOP.
Hash is whereby a hash code is used as an O(n) lookup into the other rowset. This one is good for large, unordered data sets.
Merge is whereby rows are 'consumed' from each side of the join in the correct sequence - meaning that each side must be sequenced. This one is good for any size of ordered data set.
Loop is whereby each row is matched against every other row from the other side of the join. Imagine knowing the title of a book, then comparing the title with every book in the library. While this sounds hurrendous, it will actually be more efficient for small unordered data sets than a hash join.The query optimizer assigns these roles so that the smaller of the two inputs is the build input. Hash joins are used for many types of set-matching operations: inner join; left, right, and full outer join; left and right semi-join; intersection; union; and difference.
Ankit SharmaPosted Sep 6, 2017, 11:58 AM