Consider doing a natural join operation on two relations R(A, B) and S(B, C). Assume that the R tuples are stored contiguously on 200 disk blocks (i.e.,B(R) = 200), while the S tuples are stored contiguously on 1000 blocks (i.e.,B(S) = 1000). Each block holds 20 tuples(same for R as for S). There are 51 memory blocks available. If Iteration Join Algorithm, R First is applied then calculate the I/O cost.
(A) 4200
(B) 2100
(C) 1000
(D) 200


Answer: (A)

Explanation: 200 IOs to read R into memory (50*4), then for each set of 50 R blocks we need 1000 IOs to read in R (1000*4). Therefore, the total is 50*4 + 1000*4 = 4200
So, option (A) is correct.

Quiz of this Question


  • Last Updated : 29 Nov, 2018

Share your thoughts in the comments