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

Chapter 10 485
Internal Structures and Techniques
Internal Techniques
result in poor DBPUT performance. This method should be used only if you have
determined that the potential poor performance consequences cannot occur.
The intent of the two primary address algorithms is to spread master entries as uniformly
as possible throughout the record space of the data file. This uniform spread reduces the
number of synonyms occurring in the master data set.
NOTE
In general, a master data set with a capacity equal to a prime number or to
the product of two or three primes can yield fewer synonyms than master
data sets with capacities consisting of many factors. Refer to appendix C for a
list of prime numbers. More information on dynamic data set expansion is
given earlier in this chapter.
Migrating Secondaries
In some cases, secondary entries of master data sets are automatically moved to storage
locations other than the one originally assigned. This most often occurs when a new
master data entry is assigned a primary address occupied by a secondary entry. By
definition, the secondary entry is a synonym to some other primary entry resident at their
common primary address. Thus, the new entry represents the beginning of a new synonym
chain. To accommodate this new chain, the secondary entry is moved to an alternate
secondary address and the new entry is added to the data set as a new primary entry. This
move and the necessary linkage and chain head maintenance is done automatically.
A move can also occur when the primary entry of a synonym chain that has one or more
secondary entries is deleted. Because retrieval of each entry occurs through a synonym
chain, each synonym chain must have a primary entry. To maintain the integrity of a
synonym chain, TurboIMAGE/XL always moves the first secondary entry to the primary
address of the deleted primary entry.
Space Allocation for Master Data Sets
Space allocation for each master data set is controlled by a free space counter resident in
the user label of the data set, by each bit map that monitors each block of the data set, and
by enabling of the data set for dynamic expansion.
When a data set is enabled for dynamic expansion, the expansion is triggered at run-time
during DBPUT (implied for automatic master) when the data set has reached its almost-full
capacity. Once an expansion is done, the master data set is partitioned into two areas: the
original area corresponding to the original initial capacity (hashing) and the expansion
area corresponding to all extents allocated as a result of run-time expansion. The original
area has a mixture of primary and secondary entries. The expansion area has only
secondary entries which are added using a delete chain head and end-of-file pointer (high
water mark), similar to detail data sets.
The master data sets which are not enabled for dynamic expansion have only one area
which contains both primary and secondary entries.
When a new entry is added, TurboIMAGE/XL decrements the free space counter and sets
the bit corresponding to the newly assigned record address to a one. If the bit is a zero