What Is Sequential Access?
Indexed sequential access method ( ISAM ), also known as indexed sequential access method, can record any access continuously (in the order they enter) or arbitrarily (according to the index). Each index defines a differently arranged record. Index sequential access file is a file organization method designed for disk access files, using a static index structure. [1] Since the disk is a device accessed with three levels of disk group, cylinder, and track addresses, a multi-level index of the disk group, cylinder, and track can be established for the data files on the disk. There are two access methods: the basic indexed sequential access method and the queued indexed sequential access method.
- An index file consists of a data file, which is a sequential file with an index. The index itself is very small, occupying only two fields: the key of the sequential file and the address of the corresponding record on disk. To access records in a file, follow these steps:
- (1) The entire index file is loaded into memory (the file is small and only takes up very little memory space).
- (2) Search for items and find the target key with an efficient algorithm (such as half-query method).
- (3) Retrieve the address of the record.
- (4) According to the address, retrieve the data record and return it to the user. [2]
- The composition of the ISAM file
- The SAM file is composed of a multilevel master index, a cylinder index, a track index, and a master file.
When the records of a file are stored on the same disc group, they should be concentrated on one cylinder first, and then stored sequentially on adjacent cylinders. For the same cylinder surface, it should be stored in the order of the disk surface.
- Basic Indexed Sequential Access Method (BISAM)
- When retrieving records on the ISAM file, start from the main index to find the corresponding cylinder index; find the track index of the cylinder on which the record is located from the cylinder index; find the start address of the track on which the record is located from the track index, and proceed from this Search sequentially on the track until it finds it. If there is no such record in the track, it means that there is no such record in the file; if the searched record is in the overflow area, the head pointer of the overflow linked list can be obtained from the overflow index entry of the track index entry, and then the The table is searched sequentially.
- In order to improve the retrieval efficiency, the main index can be resident in memory and the cylinder index can be placed on the cylinder at the center of the space occupied by the data file. In this way, when the cylinder index is found and the track index is found, the average head movement distance is averaged. The value is the smallest.
- Queue Sequential Access Method (QSAM)
- Similar to BISAM, QSAM arranges the storage locations of records in the order in which they are entered, forming a sequential data set. But unlike BISAM, QSAM organizes the grouping and decomposition of records, that is, the system groups multiple records into blocks. To improve performance, queue sequential access methods often read records or files into memory before they are used.