Secondary Index

26 views Asked by At

How many secondary index can be made with n attributes, I am getting as (2^n)-1 is it correct?

My approach is: we can check with one by one merging with attributes as we do in case of superkey.

I found this explanation online:

For n = 5 , we have :

No of secondary indices possible = 5P1 + 5P2 ...........+ 5P5

                                             = (5! / 4!)  + (5! / 3!) + (5! / 2!) + (5! / 1!) + (5! / 0!)

                                             = 5 + 20 + 60 + 120 + 120

                                             = 325

Hence no of secondary indices possible with 5 attributes = 325

Is the above explanation is correct?

0

There are 0 answers