An mvBase file consists of one or more groups of frames. The minimum size of a group is one frame (2048 bytes, of which 2000 are available for data). A file is referenced by its base (the frame ID of the first group). In the file dictionary, an entry for a file keeps track of the base frame ID as well as the number of groups of a file.
The number of groups is known as the file’s modulo. The modulo represents an area of contiguous space within the virtual memory storage file on the disk, known as the primary file space. This space is allocated when a file is created and remains fixed regardless of how the file grows or shrinks.
Each item is stored in a particular group. The mvBase environment uses a random- access technique known as hashing to distribute items in a file. It derives the group address of an item from the item-ID.
The result of a hashing computation is the number of a particular group (from zero to one less than the number of groups or modulo). This result is added to the base frame ID of the file to come up with a specific frame ID. Once the system locates this frame, it searches through the contents of this group sequentially to find the particular item. Thus, the mvBase environment avoids having to search sequentially through an entire file by narrowing the search to a particular group.
An item always hashes to the same group, even if that group is full. When the capacity of a group is exceeded, additional frames are taken from a table of available frames (the Overflow Table) and linked to the last frame of that group. These frames are referred to as the secondary file area. If the size of the group is reduced, the frames in the secondary file area are returned to the Overflow Table. These groups are allocated only as needed.
The liability in allowing a group to overflow into secondary frames is that additional disk reads are necessary in order to access items that are not in the primary frame of the group. Therefore, reallocating a file to increase the modulo helps to distribute items more efficiently across all groups.
See Also