Skip to main content

hash join (semi)

Short Description

The hash join (semi) performs a semi join using hash tables. A hash table is built in memory based on the smaller table and then scans the larger one looking for matches

Detailed Description

The hash join (semi) performs a semi join using hash tables. A hash table is built in memory based on the smaller table and then scans the larger one looking for matches.

Semi Joins return rows based on an EXISTS or IN subquery such as

SELECT * FROM a WHERE EXISTS (SELECT * FROM b WHERE a.a @> b.b)

Hash joins are computationally expensive and require additional memory for the hash table to be built in, which is why a merge join is preferred if possible.

If the hash table is too big for memory, it will spill to disk which will impact performance.

Search online

If this article doesn't have the information you need you can try searching online. Remember, you can contribute suggestions to this page.