in Databases
858 views
3 votes
3 votes

a. a dense index on R.B

b. a sparse index on R.B

c. a dense index on S.B

d.  a sparse index on S.B

in Databases
858 views

4 Comments

@Shaik Masthan brother still not getting it

R.B == S.B ? already S is sorted on B ===> Sparse Index on S.B
 

 

0
0
in natural join, the common attributes are equal.. In this two tables common attribute is B only !

therefore we have to check R.B == S.B

S is sorted on attribute B ===> Sparse index on S.B
0
0
got it...thanks brother!
0
0

2 Answers

2 votes
2 votes

Option (a) A dense index on R.B

Here it is given that R is sorted on attribute A and S is sorted on attribute B. As R is already sorted on attribute A, so it may or may not be sorted with respect to attribute B. Hence secondary indexing(since it may be non-key or candidate key and the file may be unordered w.r.t B) has be present for R where the key field is R.B. As secondary indexing is dense indexing, hence a dense index needs to be formed on the attribute R.B.

4 Comments

how can we decide what will become key in R⋈S? why didn't we do indexing on S.B rather on R.A?
0
0
We dont need to know what will become the key in R$\bowtie$S. Here join attribute is B, so in order to be able to access R.B and S.B, we need a dense index on R.B(since R is unsorted wrt field B) and a sparse index on S.B(since S is already sorted wrt field B).
1
1
check the comments
0
0
Yes both A and D options are correct.
1
1
1 vote
1 vote

Option D should be a correct answer...  
The concept is in the data file attribute on which the entries are in sorted order use each block anchor as index entry...

Not all entries... If you are forced to store all data file entries then DENSE otherwise SPARSE.

Then Ans is Option D.

1 comment

check the comments
0
0