What is Dense and Sparse Indexing with examples

Dense index:
A dense index in databases is a file with pairs of keys and pointers for every record in the data file. Every key in this file is associated with a particular pointer to a record in the sorted data file. In clustered indices with duplicate keys, the dense index points to the first record with that key.

Sparse index:
A sparse index in databases is a file with pairs of keys and pointers for every block in the data file. Every key in this file is associated with a particular pointer to the block in the

sorted data file. In clustered indices with duplicate keys, the sparse index points to the lowest search key in each block. primary key is a sparse index.

Examples:
Figure 1 and 2 shows the Sparse and Dense indexing.

figure101 
Figure 1: Dense Index

 figure106
Figure 2: Sparse index

Comments

Popular Posts