Indexing Flashcards

1
Q

What is an index?

A

A data structure that allows for fast lookup for records in a file

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

Can an index allow records to be retrieved in sorted order?

A

Yes it can allow that

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

Describe a data file and and index file

A

Data File: the file that actually contains the records

Index File: The file that stores the index information

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

What is a Search Key

A

The set of attributes stored by the index to the find records in the data file

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

does the search key have to be unique?

A

NO it doesn’t, more than one record may have the same search key value

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

What is an index entry?

A

One index record that contains a search key value and pointer to the location of the record with that value

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

What is the difference between ordered and unordered files?

A

Ordered files are sorted on the search key, unordered files are not

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

Dense vs Sparse indexes

A

A dense index has an index entry for every record in the data file

A sparse index has index entries for only some of the data file records

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

Primary (clustering) indexes vs Secondary indexes

A

A primary index sorts the data file by its search key. The search key doesn’t have to be the same as the primary key

A 2NDary index doesn’t determine the organization of the data file

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

Single-Level vs Multi-Level indexes

A

Single-level indexes have only one index level

multi-level indexes have several levels of indexes on the SAME FILE

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

Formula for sparse index based on key?

A

log2(N)

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