The second hash function (h2) simply speeds up the matching process. Without it, would need to scan entire R partition for each record in S partition.
h2