Primary Index Clustering Index Secondary Index
Ordered file Ordered file Ordered file a secondary means of accessing a file.
Data file is ordered on a key field (distinct value for each record) Data file is ordered on a non-key field (no distinct value for each record) Data file is ordered maybe on (1 - candidate key has a unique value), (2 - a non-key with duplicate values)
One index entry for each disk block. key field value is the first record in the block, which is called the block anchor. One index entry for each distinct value of the field. The index entry points to the first data block that contains records with that field value. The index is an ordered file with two fields: (1 - field value.), (2 - it is either a block pointer or a record pointer.)
Non dense (sparse) index Non dense (sparse) index If key -> dense — If non key -> dense or sparse index