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

474 Chapter10
Internal Structures and Techniques
Data Set Internal Structures
Figure 10-3. Media Record for Secondary Entry
When more than one detail chain head is present, they are physically ordered left-to-right
in the order that the associated paths are specified in the schema.
Primary Entries
Selection of record addresses for master entries begins with a calculated address
determined by a hashing algorithm applied to the value of each entry's key item. The
algorithm is described later in this chapter. Each such calculated address is known as a
primary address and each entry residing at its primary address is called a primary
entry.
Secondary Entries
A new entry with a unique key item value will be assigned the same primary address as an
existing primary entry whenever the key item values of both entries generate the same
calculated address. When this occurs,the entries are considered synonyms of one another.
TurboIMAGE/XL assigns the new entry a secondary address obtained from unused
records in the vicinity of the primary entry. For master sets which are designated for
dynamic expansion, a secondary address may also be obtained from the expanded area.
Each entry residing at a secondary address is called a secondary entry.
Synonym Chains
When multiple data entries "arrive" at the same primary area, they are linked together to
form a synonym chain. A synonym chain consists of the primary entry and all of the data
entries with key values that hash to the same key location. Each synonym chain is
maintained by a 10-byte chain head in the media record of the primary entry and 10-byte
links in the media records of the secondary entries. A master data set entry can contain
both a synonym chain head and multiple detail chain heads. These are two distinct types
of chain heads.
If no secondary entries are present, the synonym chain count is one (for the total number
of entries that hash to this location) and the pointers to the first and last secondary entries
are zeros. If one or more secondaries are present, the synonym chain count is equal to the
total number of entries that hash to the same primary address and the pointers reference
the first and last secondary entries.