S1: A hash index must be a dense index
S2: A B+ tree index can be a sparse index
Which one of the following options is correct?
Correct : a
The correct answer is Option A - Both S1 and S2 are true.
An index is called dense if it contains an entry for every search-key value in the file. If some search-key values do not have corresponding entries, the index is called sparse.
S1: A hash index must be a dense index
In hash indexing, a hash function is used to map each search-key value directly to a bucket. For efficient equality search, the system needs to locate records using the exact key, so entries are maintained for every search-key value. Collisions are handled within buckets, but the index still points to all values. Hence, hash indexes are dense. So, S1 is true.
S2: A B+ tree index can be a sparse index
B+ tree indexes allow flexibility in how entries are stored. At the leaf level, it is possible to store entries for every record (making it dense). However, in cases like primary or clustered indexing, the leaf nodes may store entries only for the first record of each block, along with block pointers. This makes the index sparse. Hence, a B+ tree can be implemented as a sparse index. So, S2 is true.
Therefore, both S1 and S2 are true.
Similar Questions
Total Unique Visitors