GATE 2014 CS (CS2) – Question 40
A nested-loop relational join of r(R) and s(S) uses three disk-block-sized buffers, one reserved for results. If size(r) < size(s), disk accesses are fewer when ______.
Practise this question in The GATE Grind →
Show answer and explanation
Correct answer: (A) r is the outer relation
Explanation
With one buffer per input and one output buffer, a block nested-loop join costs b_outer+b_outer b_inner input reads. The product term is symmetric, so putting smaller r in the outer loop reduces the additive term. Hence **A**. The join selectivity does not change this full nested-loop scan cost.