Slide 16.1: Indexed sequential file access
Slide 16.3: Maintaining a sequence set (cont.)
Home

Maintaining a Sequence Set


This section focuses on the sequential part of the ISAM of keeping a set of records, a sequence set, in physical order by key as records are added and deleted. Sorting and resorting the entire sequence set are not feasible. We need instead to find a way to localize the changes. Collecting the records into blocks can restrict the effects of an insertion or deletion to just a part of the sequence set. There are three cases for the use of blocks:
  1. An initial blocked sequence set: Suppose we have records that are keyed on last name and collected together so there are four records in a block. We also include link fields in each block that point to the preceding and following block. Only the forwarding links are shown.


    When we block records, the block becomes the basic unit of input and output. We read and write entire blocks at once. Therefore, the buffer size we use in a program is such that they can hold an entire block.

  2. Overflow: The overflow condition can be handled by block-splitting process. Inserting a new record with the key CARTER causes Block 2 to split. The contents are divided between Blocks 2 and 4.