Discussion
An index in a DBMS is said to be dense if an index entry appears for every search-key value in the indexed file. Otherwise it is called a sparse index. Consider the following two statements.
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?
Answer: A
Both S1 and S2 are true.
S1: A hash index scatters search keys across buckets by their hash values, with no ordering. A sparse index works only when the file is sorted on the key, so that an entry for one key also locates its neighbours. A hash index has no such order to exploit, so it must hold an entry for every search-key value: it must be dense.
S2: A B+ tree built on the sort key of a clustered (sorted) file can store just one entry per block, the first key in each block, and still locate any record by scanning within the block. So a B+ tree index can be sparse. It is dense when it is a secondary index on an unsorted attribute.
Since both statements hold, the options calling either one false are wrong.
Post your comment
Please log in or register to post a comment.
Examination Categories
- SSC Exams
- Banking Exams
- Teaching Exams
- Civil Services Exams
- Railways Exams
- Engineering Recruitment Exams
- Defence Exams
- State Government Exams
- Police Exams
- Insurance Exams
- Nursing Exams
- Other Government Exams
- NRA CET
- PG Entrance Exams
- Campus Placement
- MBA Entrance Exams
- CUET and UG Entrance
- Judiciary Exams
- Regulatory Body Exams
- Software Development