Open In App

GATE | Gate IT 2005 | Question 84

Like Article
Like
Save
Share
Report

A database table T1 has 2000 records and occupies 80 disk blocks. Another table T2 has 400 records and occupies 20 disk blocks. These two tables have to be joined as per a specified join condition that needs to be evaluated for every pair of records from these two tables. The memory buffer space available can hold exactly one block of records for T1 and one block of records for T2 simultaneously at any point in time. No index is available on either table. If Nested-loop join algorithm is employed to perform the join, with the most appropriate choice of table to be used in outer loop, the number of block accesses required for reading the data are  

(A)

800000

(B)

40080

(C)

32020

(D)

100



Answer: (C)

Explanation:

Number of block access = nr * bs + br where br and bs are number of blocks in relations R and S respectively, and nr is the number of tuples in relation R. 
We select the relation with small number of tuples as outer relation R. So, R is T2. 
Number of block access = 400 * 80 + 20 = 32020 
 
Thus, option (C) is correct. 


Quiz of this Question
Please comment below if you find anything wrong in the above post


Last Updated : 28 Jun, 2021
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads