Index Sequential Access Method

from Wikipedia, the free encyclopedia

Index Sequential Access Method ( ISAM ) is an access method developed by IBM at the end of the 1960s for data records in a file that permits both (sorted) sequential and random ( random ) index-based access.

A file can have several different indexes. Each index defines a different order of the records, depending on what information is being sought. For example, a customer file can be sorted alphabetically according to the surname or numerically according to the zip code, provided corresponding indices exist.

The index sequential access method, which is also used in database systems , enables the access speed to be optimized depending on the task. Since the first COBOL standards around 1970, ISAM has been part of the standard of the COBOL language in the file control section. A very early further development of ISAM, also from IBM, but not standardized, is the Virtual Storage Access Method (VSAM).

Storage structure

Index sequential file organization: One-level index

The data records are grouped in blocks or pages. A simple index refers to the lowest key of a data block in the main file, which is sorted in ascending order. A simple, single-level index file consists of index entries that refer to data blocks in the main file. As a rule, the index is multilevel, with the index levels again being organized index-sequentially.

  • Search in an ISAM file: Search the key sequentially in the index file until it is found or the index is larger than the key you are looking for. In the second case, with a multi-level index, it is now known which index page the key sought can be on. The search process continues there until the key is found or not found.
  • Insert : First search , then check whether the new sentence fits on the page. If yes, insert sorted, if not, insert a new record on the next page or overflow page and update index pages.
  • Delete : First search , then mark the sentence as deleted . If it was the first sentence on the page or if the page is now blank, adjust index pages.

A disadvantage of the ISAM file organization can be seen from the insert and delete operations. The main file and index are static, new records are often stored in overflow blocks and this slows down searches. Rapidly growing or changing files must therefore be regularly reorganized, which is time-consuming.

Method 2

The above method hasn't been used for very long. Succession was a tree / leaf structure based method. This made it possible to determine by a few comparisons where the searched sentence was or should be inserted.

Structure of the key of the Isam file (index).

 *****************************************************************
 *   BLATT-NR                  *                 VATER           *
 *****************************************************************
 *                                                               *
 *                  BLATTINHALT (KEY)                            *
 *                                                               *
 *****************************************************************
 *   LINKER SOHN               *             RECHTER SOHN        *
 *****************************************************************

First entry at the beginning of the file ( root ).

Example COBOL

File control paragraph with frame

The picture shows the file control section for an ISAM file a modern COBOL - compiler :

  • SELECT ... ASSIGN TO: Assignment of external file name to internal file name
  • WITH COMPRESSION | WITH ENCRYPTION: optionally with compression or encryption
  • ORGANIZATION IS INDEXED
  • ACCESS MODE IS SEQUENTIAL | RANDOM | DYNAMIC: alternatively one of the three access methods. Sequentially, by index, or both, i.e. H. times via index, sequentially from this starting point and vice versa.
  • RECORD KEY IS key-name [= seg-name ...] [WITH [NO] DUPLICATES]] ...: The (primary) key can consist of several segments, i. H. individual fields of the data record, duplicate keys can be allowed. The fields, of which only parts can be used as a (partial) index, are - as usual in COBOL - to be defined in the FILE DESCRIPTION.
  • ALTERNATER RECORD KEY IS ...: further indices can be defined.
  • LOCK MODE IS EXCLUSIVE | AUTOMATIC | MANUAL ...:
  • RESERVE {number} ALTERNATE AREA:
  • COLLATING SEQUENCE IS alphabet name:

ISAM today

"ISAM files are still used today, namely whenever the use of a relational database is not really worthwhile (data volume, structure, performance, costs, etc.)." There is probably still more data stored in ISAM files than in relational databases. This is not just about data from COBOL environments, but especially under UNIX, the index-sequential access method has found widespread use during the transition from mainframe to UNIX systems thanks to the implementation of C-ISAM from Informix . Based on ISAM, the MyISAM database system was also developed, which is implemented in the widely used MySQL database management system. In addition, Microsoft's Extensible Storage Engine (ESE, also known as Jet Blue ) is based on ISAM. The ESE serves (e) z. B. as a database for Microsoft Active Directory and Exchange .

Web links