TurboIMAGE/XL Database Management System Reference Manual MPE/iX V6.5 (30391-90011)

472 Chapter10
Internal Structures and Techniques
Data Set Internal Structures
Data Set Internal Structures
The following internal structures are used by TurboIMAGE/XL to manage the information
in data sets.
Pointers
TurboIMAGE/XL uses pointers to link one data set record to another. A pointer is a value
containing the block number in the first three bytes plus one byte that contains the offset
within the block for a given data entry.
Data Chains
A data chain is a set of detail data set entries that are bi-directionally linked together by
pairs of pointers. All entries with a common search item value are placed in the same
chain. Each chain has a first and a last member. The pointer pairs constitute backward
and forward links to the entry's predecessor and successor within the chain. The first
member of a chain contains a zero backward pointer and the last member of a chain
contains a zero forward pointer. A single chain can consist of at most 2
31
1 (2,147,483,647)
entries.
Chain Heads
TurboIMAGE/XL locates the first or last member of a chain within a detail data set by
using a chain head. The chain head for a particular chain is stored in the corresponding
master data set with the entry whose key item value is the same as the detail search item
value. Each chain head is 12 bytes long. The first four bytes contain a count of the number
of member entries in the referenced chain. The count is zero if the chain is empty. The
remaining eight bytes contain two pointers. One points to the last chain entry, the other to
the first chain entry. If the count is zero, these pointers are both zero. If the count is one,
these pointers have the same value.
Media Records
TurboIMAGE/XL transfers information to and from a storage location on disk in 4096-byte
pages using the system storage manager. Access to the data in memory is synchronized
through blocks of media records. A media record consists of both a data entry and its
pointers or a null record if no data entry is present.
Media Records of Detail Data Sets
For each detail entry, the media record consists of the data entry itself preceded by all of its
related data chain pointer pairs. The number of pointer pairs corresponds to the number of
paths specified for the data set within the schema. Figure 10-1. illustrates a media record
for a detail data set defined with two paths. The first set of pointers corresponds to the first
path defined in the set part of the schema and the second set corresponds to the second
path.