In nested joins, for each tuple in the outer join relation, the
system scans the entire inner-join relation and appends any tuples that match
the join-condition to the result set.
Merge join
Merge join If both join relations come in order, sorted by the join
attribute(s), the system can perform the join trivially, thus: It can consider
the current group of tuples from the inner relation which consists of a set of
contiguous tuples in the inner relation with the same value in the join
attribute. For each matching tuple in the current inner group, add a tuple to
the join result. Once the inner group has been exhausted, advance both the
inner and outer scans to the next group.
Hash join
A hash join algorithm can only produce equi-joins. The database system
pre-forms access to the tables concerned by building hash tables on the
join-attributes.