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).