Quiz 9, Q&Adi
Q. Describe sequential file organization scheme?
A.
Fixed format used for records
Records are the same length
Field names and lengths are attributes of the file
One field is the key field; Uniquely identifies the record, Records are stored in key sequence
Q. Describe indexed sequential file organization scheme? Compare with sequential file organization scheme?
A.
Index provides a lookup capability to quickly reach the vicinity of the desired record.
Contains key field and a pointer to the main file.
Indexed is searched to find highest key value that is equal or less than the desired key value.
Search continues in the main file at the location indicated by the pointer
Comparison of sequential and indexed sequential lookup;
Example: a file contains 1 million records. On average 500,000 accesses are required to find a record in a sequential file. If an index contains 1000 entries, it will take on average 500 accesses to find the key, followed by 500 accesses in the main file. Now on average it is 1000 accesses.