0

I need to know how the primary index is classified as a sparse index?

The sparse index as described by some aticles and books has index entries for only some of the search values and has a fewer entries than the number of records in the file. When you make the primary key you choose a column that will include a unique value for each record entry. So when you make and index on that key there must an index entry for each unique value.

So how the primary index is classified as a sparse index that has only some of entries?!!!

2
Contributors
2
Replies
17
Views
2 Years
Discussion Span
Last Post by Amr_Mohammad_R
0

A primary index cannot be a sparse index as primary indexes cannot hold NULL values.
You can use a sparse column as part of a clustered key though.
Is that what you are asking?

0

Indexes can also be characterized as dense or sparse. A dense index has an index entry for every search key value (and hence every record) in the data file. A sparse (or nondense) index, on the other hand, has index entries for only some of the search values. A sparse index has fewer entries than the number of records in the file. Thus, a primary index is a nondense (sparse) index, since it includes an entry for each disk block of the data file and the keys of its anchor record rather than for every search value (or every record).

Fundamentals of Database Systems, 6th Edition

Edited by Amr_Mohammad_R

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.