The simplest join algorithm is a nested loop that joins the two relations together a tuple at
a time. The outer loop iterates over each tuple in one relation R, and the inner loop iterates
over each tuple in the second relation S. However, as we know that the basic unit of
reading/writing is a disk block, we can improve on the basic algorithm by having two
additional loops that process blocks, as indicated in the outline algorithm of Figure 21.8.
Since each block of R has to be read, and each block of S has to be read for each block
of R, the estimated cost of this approach is: