Communicator 3000 MPE/iX Release 6.0 (Platform Software Release C.60.00) (30216-90269)

158 Chapter 10
Technical Articles
IMAGE/SQL with TurboIMAGE/XL Enhancements
Following the first expansion, the master data set can be perceived as
having two areas, original area and expanded area, managed
differently. The original area is managed in the same way as in releases
prior to MDX, that is, the primary address for the new entry is
calculated using the hashing algorithm and the secondary address is
assigned according to the availability of the free entry, but with
modifications in searching for a free entry. The use of the expanded area
is controlled using the pointer to a delete chain head and the last entry
used in the file (high-water mark) as in detail data sets. Subsequent
expansions belong to the expanded area. The original area can have
primary entries and secondary entries, while the expanded area can
only have the secondary entries. Note that the primary capacity (also
hashing or initial capacity) used to calculate the primary address does
not change. In essence, the dynamic expansion results in allocating
additional space for secondary entries which implicitly makes room for
additional primary entries in the original area. The primary address of
a new entry is calculated using the value of the entry's key item and
primary capacity 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.
To elaborate further, when a DBPUT for a 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 already occupied by a primary entry which
hashed to the same address, TurboIMAGE/XL scans a few blocks
(predetermined based on internal values, also known as quick
search) in the close proximity of the primary address to find a free
entry (empty entry). If found, the new entry resides at this
secondary address in the original area. Otherwise, search for a free
entry is directed towards the expansion area. At this point, if the set
has not been expanded at all and can be expanded, expansion will
take place and the new entry will reside at the first entry address in
the new expanded area.
If prior expansion has already taken place, the pointer to the delete
chain head and the last entry used in the file 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, and the new
entry becomes the last entry in the synonym chain. If the expanded
area is full and can be expanded, it is further expanded to
accommodate the new entry.