Master Set

Each master set entry contains a key item pointing to a subset of detail set en tries, all with related values in a particular data item. Th us, you can quickly reference any subset of entries by ￿nding its master k ey item (index poin ter). Each master set can con tain values for one detail data item to searc h. (In other words, it can have only one ￿eld as a k ey item.) However, each master set can pro vide indexing for a maximum of 16 detail sets b y using a key item in the master set as an index for a maximum of 16 detail sets. Eac h detail set can be linked to 16 master sets and can con tain a maximum of 16 searc hable data items. A master set can be automatic or man ual.

Chain Head

In a master set data en try, the key item and the data items accompan ying it are called a c hain head. It consists of:

A count number indicative of the n umber of detail entries with matc hing key item values.

The pointer to the last data en try in the detail set whose k ey item value matches the value of the master set k ey item.

The pointer to the ￿rst data en try in the detail set whose k ey item value matches the value of the master set k ey item.

The data itself.

In the detail set, the ￿rst and last data en try described by the pointers in the chain head are the beginning and ending of the c hain of data entries in the detail set that ha ve the same value for the associated data item as the master set k ey item. A chain can have a maximum of 2**31 data en tries. If more than one master set references a particular detail set, additional pointers are made available in the detail set.

A chain can be searched in either a forward or bac kward direction. This is con venient, for example, in an application that adds new in voice numbers to an existing data set. Otherwise, you can follow the poin ter directly to the last en try in the chain and add a new entry using a minimum of disc overhead. New entries are automatically added at the end of the c hain, unless the chain is sorted. Although poin ters occupy space, usually a database tak es less space than the MPE/iX ￿les it replaces. This is because the reduction in data redundancy can outweigh the internal overhead of maintaining a TurboIMAGE/XL database. Figure 7-4 shows an example of ho w chain heads in a master set are used in T urboIMAGE/XL data set organization.

7-12 Data Management