• Partitioning phase: We try to split R and S into partitions. Each partition has and (i.e. partition i of and partition i of ) and make sure either or pages. If not, recursively do partition.
    • Make sure records with same hash value are in the same partition.
  • Build & Probe Phase: Load the smaller partition into memory and build an in-memory hash table. Perform a Naive Hash Join with the larger partition in the pair.

I/O COST:

  • First phase: read + write both relations
    • I/Os
  • Second phase: read both relations, forward output
    • I/Os
  • Total cost of 2-pass hash join =