0% found this document useful (0 votes)
94 views10 pages

Indexed Sequential Access

The document discusses indexed sequential access, which allows both indexed and sequential access to records simultaneously. It does this through the use of blocks to maintain a sequence set of records in physical key order. Blocks can be rearranged as records are added or deleted to localize changes. An index, such as a B+ tree, is constructed over these blocks to allow indexed access. The combination of the indexed structure and sequence set of blocks stored at the same block size provides complete indexed sequential access.

Uploaded by

Loay Mohamed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
94 views10 pages

Indexed Sequential Access

The document discusses indexed sequential access, which allows both indexed and sequential access to records simultaneously. It does this through the use of blocks to maintain a sequence set of records in physical key order. Blocks can be rearranged as records are added or deleted to localize changes. An index, such as a B+ tree, is constructed over these blocks to allow indexed access. The combination of the indexed structure and sequence set of blocks stored at the same block size provides complete indexed sequential access.

Uploaded by

Loay Mohamed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 10

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.

• Here, we are looking for a single organizational method that provides


both of these views simultaneously.

• Why care about obtaining both views simultaneously? If an application


requires both interactive random access and cosequential batch
processing, both sets of actions have to be carried out efficiently. (E.g.,
a student record system at a University).
Maintaining a Sequence Set: The Use of
Blocks
• A sequence set is a set of records in physical key order which is such
that it stays ordered as records are added and deleted.

• 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.

• However, there are certain costs associated with this approach:


• A Blocked file takes up more space than an unblocked file because of internal
fragmentation.
• The order of the records is not necessarily physically sequential throughout
the file. The maximum guaranteed extent of physical sequentially is within a
block.
Sequence Set : Example
• Block of Order 5
Sequence Set : Example
Maintaining a Sequence Set: The Use of
Blocks
• An important aspect of using blocks is the choice of a block size.
There are 2 considerations to keep in mind when choosing a block
size:

• 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.

• We can construct an index for these blocks.

• 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 ?

• Because usually they are stored on the same file

• Easy Buffering Schema

You might also like