Practice mode DBMS and SQL

Why must a secondary index, built on a key that is not the file’s sort order, be a dense index?

Correct answer C. Because the records are not sorted on that key, so every key value needs its own index entry

Explanation

A sparse index stores entries for only some keys and relies on records being in the same order, so you find the nearest smaller key and scan forward. With a secondary index the file is ordered by a different key, so matching records can be anywhere; skipping entries would make records unreachable. A dense index has an entry for every search-key value, and secondary keys need not be unique.

Report a problem

Answer checked How we write and check questions

Tip: press A, B, C or D to answer, and N for the next question.

Advertisement

Have a question about this answer?

Your email address will not be published. Required fields are marked *

Links and website addresses are not allowed in comments.