Clustering Index and Secondary Index
A clustering index is a type of index that physically orders the records in a file on a non-key field. This can be used to speed up retrieval of records that have the same value for the clustering field. A secondary index is another type of index that can be used to speed up retrieval of records based on a non-key field.
Questions
- What is a clustering index?
- How does a clustering index differ from a primary index?
- What is a secondary index?
Answers
- A clustering index is a type of index that physically orders the records in a file on a non-key field. This can be used to speed up retrieval of records that have the same value for the clustering field.
- A clustering index differs from a primary index in that a primary index requires that the ordering field of the data file have a distinct value for each record. A clustering index, on the other hand, can have duplicate values for the clustering field.
- A secondary index is another type of index that can be used to speed up retrieval of records based on a non-key field. Secondary indexes are not required to be unique, and they can be used to improve the performance of queries that involve range searches or comparisons other than equal.