Flashcards
Files and Indices
Cards in this deck (21)
- 1True or false: heap files are ordered.False
- 2What is a heap file?A heap file is any file which is grown by appending rows to the end of the file as they are inserted.
- 3What is the primary setback with using heap files?Deleted rows create gaps in the file, and so the file must be periodically compacted to recover space.
- 4In a heap file, inserting a row takes: a) F-1 page transfers b) F page transfers c) F+2 page transfers d) F+1 page transfersb) F page transfers
- 5In a heap file, searching for a row (assuming the row exists) takes on average: a) F page transfers b) F+1 page transfers c) F/2 page transfers d) F/3 page transfersc) F/2 page transfers
- 6In a heap file, searching for a row (assuming the row does NOT exist) takes on average: a) F page transfers b) F+1 page transfers c) F/2 page transfers d) F/3 page transfersa) F page transfers
- 7In a heap file, deleting a row (assuming the row exists) takes on average: a) F page transfers b) F/2 page transfers c) F/2 + 1 page transfers d) F/2 - 1 page transfersc) F/2 + 1 page transfers
- 8In a heap file, deleting a row (assuming the row does NOT exist) takes on average: a) F page transfers b) F/2 page transfers c) F/2 + 1 page transfers d) F/2 - 1 page transfersa) F page transfers
- 9Why is heap file organization inefficient when a subset of rows is requested?Because heap files aren't ordered, F pages need to be read to obtain the requested subset of rows.
- 10True or false: the access path for a sorted file is linear search.False; the access path for a sorted file is binary search.
- 11True or false: Because successive rows are in same/successive pages, cache hits are likely in a sorted file.True
- 12Between heap files and sorted files, which generally has a lower seek time and why?Sorted files; by storing all pages on the same track, seek time can be minimized.
- 13In a sorted file, searching for a position takes: a) log_2 F page transfers b) log_10 F page transfers c) log_2 F^2 page transfers d) (log_2 F) - 1 page transfersa) log_2 F page transfers
- 14In a sorted file, inserting and writing each take on average: a) F page transfers b) F/2 page transfers c) F-1 page transfers d) F+1 page transfersb) F/2 page transfers
- 15True or false: a search key guarantees uniqueness.False; a search key is a sequence of attributes and does not guarantee uniqueness. It is just used for searching.
- 16Choose the answer that fits the statement. When index entries and data records are stored on the same index, we have what is called an/a [unclustered/clustered] index.clustered
- 17Choose the answers that fit the statement. We may only have one [unclustered/clustered] index, but we may have many [unclustered/clustered] indices.clustered
unclustered - 18True or false: clustered indices are not good for range queries.False
- 19True or false: clustered indices can be sparse or dense.True
- 20What is the goal of indices (i.e. what exactly is their function)?Take a search key value as input and efficiently locate the record(s) that are relevant.
- 21Choose the terms that fit the statement. Unclustered indices are [unseparated/separated] and [sparse/dense].separated
dense
Information
- Description
- File and Database Management Flashcards on Files and Indices, created by Chuck H on 12/04/2019.
- Created by
- Chuck H · Apr 2019
- Updated
- Apr 13, 2019
- Views
- 0
- Rating