Indexxing Flashcards

1
Q

what is primary and secondary indexing?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

what is a dense index?

A

the index points to the first in the list of things that match i.e music finance etc and then they follow from there

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

what is a sparse index?

A

index only some of the records, to find a record K chose the index record with the greatest value <= K
then scan sequentially

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

dense vs sparse?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly