590 views
0 votes
0 votes
Consider the simple nested-loop join of the following two relations r and s.

 

  Relation                 r                    s

Tuples (n)            2400              1500

Blocks (b)            40                   50

 

Assuming the worst case memory availability, i.e., the memory can hold only one block of each relation at a time, what is the number of block transfers and seeks?

 

1. Transfers = 120040, seeks = 4800

2. Transfers = 4800, seeks = 120040

3. Transfers = 60050, seeks = 3000

4. Transfers = 3000, seeks = 60050

2 Answers

0 votes
0 votes

In nested loop join,

In the worst case, if there is enough memory only to hold one block of each relation, the estimated cost is  ( nr * bs + br ) block transfer.

nr =  2400

bs=  50

br = 40

so total number of block transfer is :

(2400 * 50) + 40 

= 120,000 + 40

= 120,040

and total number of seek = nr + br  =  2400 + 40 = 2440

but it is given as  2 * 2400 = 4800  seeks ..

I think number of seek in given option is wrong, it should be 2440.

option A is only correct .

0 votes
0 votes
As Relation s has less number of records hence it should be placed in the outer loop.
 

therefore number of block transfers is given by:   b(s)+b(r)*n(s)   where b(s) is the number of blocks in relation s and b(r) is number of blocks in relation r and n(s) is number of tuples in relation s .

substituting the values we get transfers=50+1500*40====60050

 

now, number of seeks is given by 2*n(s)=2*1500=3000

therefore option (3) is correct
Answer:

Related questions

1 votes
1 votes
0 answers
4
gulsanchouhan asked Sep 28, 2017
342 views
Which of the following can be described as a programming model used to develop applications processing massive amounts of data in a distributed and/or parallel manner?1. ...