TurboIMAGE/XL Database Management System Reference Manual MPE/iX V6.5 (30391-90011)
478 Chapter10
Internal Structures and Techniques
Dynamic Data Set Expansion
new entry is calculated using the value of the entry's key item in the hashing algorithm.
The new entry can reside either at its primary address in the original area, or in the close
vicinity of the primary address in the original area, or in the expanded area. The use of
expanded area is controlled using the pointer to a delete chain head and an end-of-file
pointer (high-water mark) as in detail data sets.
To elaborate further, when a DBPUT for manual master, or implied DBPUT to an automatic
master, is processed, the address where the new entry resides is based on the following:
1. If the primary address in the original area is not occupied, the new entry resides there.
The new entry also becomes a synonym chain head with a count of one.
2. If the primary address is occupied by another primary entry, TurboIMAGE/XL scans a
few blocks (quick search) in the close proximity of the primary address to find an
unoccupied address (empty record). If found, the new entry resides at this secondary
address in the original area. Otherwise, the pointer to the delete chain head and the
end-of-file pointer for the expansion area are interrogated to determine the secondary
address in the expansion area for the new entry. When there is room, the new entry is
assigned a secondary address in the expanded area. If the expanded area is full and can
be expanded, it is further expanded to accommodate the new entry. When there is no
room in the expanded area and cannot be expanded further, however, there is room in
the original area, the original area is scanned once again (long search) to find a
secondary address for the new entry. If an unoccupied address is found, the new entry
resides there, and it becomes the last entry in the synonym chain. Otherwise, the set is
full and DBPUT will fail.
3. If the primary address is occupied by a secondary entry, a secondary entry is relocated
to another secondary address in either the original area or the expansion area as
described above. The new entry becomes a synonym chain head with a count of one.
TurboIMAGE/XL performs synonym chain maintenance for the secondary entry which
relocates.