Let B(r) and B(s) be the number of disk blocks occupied by relations r and s, respectively.
We are given that 3 buffer blocks are available in total, with 1 buffer block reserved for the output/intermediate results. This leaves 2 buffer blocks for the input relations (i.e., 1 buffer block for the outer relation and 1 buffer block for the inner relation).
For a block nested-loop join:
If relation r is the outer relation, the total number of block accesses is:
Cost=B(r)+B(r)×B(s) If relation s is the outer relation, the total number of block accesses is:
Cost=B(s)+B(s)×B(r)
Comparing the two costs:
[B(r)+B(r)×B(s)]−[B(s)+B(s)×B(r)]=B(r)−B(s) Since size(r(R))<size(s(S)), we have B(r)<B(s), which means B(r)−B(s)<0.
Therefore, placing the smaller relation r(R) in the outer loop yields fewer disk block accesses. Hence, option (A) is correct.