Indexed Sequential Access
Indexed Sequential Access
Indexed Sequential Access
Chapter 10
Indexed Sequential Access
• Up to this point, we have had to choose between viewing a file from an
indexed point of view or from a sequential point of view.
• Since sorting and resorting the entire sequence set as records are
added and deleted is expensive, we look at other strategies. In
particular, we look at a way to localize the changes.
• The idea is to use blocks that can be read into memory and rearranged
there quickly. Like in B-Trees, blocks can be split, merged or their
records re-distributed as necessary.
Maintaining a Sequence Set: The Use of
Blocks
• Using blocks, we can thus keep a sequence set in order by key without
ever having to sort the entire set of records.
• The block size should be such that we can hold several blocks in memory at
once
• the block size should be such that we can access a block without having to
bear the cost of a disk seek within the block read or block write operation.
An Index over Sequence Set : B+ Tree
• Each of the blocks we created for our Sequence Set contains a range of
records that might contain the record we are seeking.
• The combination of this kind of index with the sequence set of blocks
provides complete indexed sequential access.
• We can use a B+ Tree which is a B-Tree index plus a sequence set that holds
the records.
An Index over Sequence Set : B+ Tree
Changes localized to
single blocks in the
sequence set:
Make the changes to
the sequence set and
to the index set.
Common Block Size Between index set and
sequence set
• The index set node size and sequence set block size are usually the
same : why ?