Two-pass algorithm for ⋈ (join) based on hashing