Creating, Loading and Re-writing
The index is represented as an array of records. The loading into memory can be done sequentially, reading a large number of index records (which are short) at once.
What happens if the index changed but its re-writing does not take place or takes place incompletely?
- Use a mechanism for indicating whether or not the index is out of date.
- Have a procedure that reconstructs the index from the data file in case it is out of date.