Indexxing Flashcards
what is primary and secondary indexing?
for a sequentially ordered file
the primary index is the index whose search key specifies the order of records in the data file
others are secondary indices
index record appears for every search key value in the file
what is a dense index?
the index points to the first in the list of things that match i.e music finance etc and then they follow from there
what is a sparse index?
index only some of the records, to find a record K chose the index record with the greatest value <= K
then scan sequentially
dense vs sparse?
Advantages:
– dense index gives faster lookups
– sparse index takes less space and requires less maintenance
A good compromise:
– use sparse index with an index record for every disk block
– index corresponds to least key value in block