766 views
2 votes
2 votes
A databse T1 has 4000 records and occupies 50 disk blocks.Another table T2 has 300 records and occupies 20 disk blocks.These two tables have to be joined as per a specified join condition that need to be evaluated for every pair of records from these two tables>The memory buffer space available can hold exactly one block of record for T1 and one block of rec for T2 simultaneously at any point in time.No index is available on either table.If nested loop join algo is emloyed to perform join with most appropriate choice of table to be used in outer loop, number of block accesses req for reading data is

1 Answer

1 votes
1 votes

@Gaurangi Katiyar watch this video for concept https://www.youtube.com/watch?v=rT4eI3p3tVk

R natural join S

Here, R is outer relation and S is inner relation. For a minimum number of block accesses, outer relation should be smaller.

Therefore R is T2

NR = Total Number of records in R

BR = Number of blocks in R

Number of total block accesses = BR + NR*BS (for nested loop join) = 15020

Number of total block accesses = BR + BR*BS (for Block nested loop join) = 1020

Related questions

1 votes
1 votes
1 answer
1
Gaurangi Katiyar asked Jan 16, 2019
353 views
Let a relation R with n tuples occupying X blocks and relation S with m tuples occupying Y blocks. 5 blocks of main memory are allocated to store records of R and S to pe...
1 votes
1 votes
0 answers
2
Gaurangi Katiyar asked Dec 29, 2018
638 views
1 votes
1 votes
1 answer
3
Aditya Bahuguna asked Jan 4, 2018
423 views
1 votes
1 votes
0 answers
4
Pawan Kumar 2 asked Jan 2, 2018
565 views
Are block transfers and block access same ?