Dynamic Data Set Expansion [ TurboIMAGE/XL Database Management System Reference Manual ] MPE/iX 5.5 Documentation
TurboIMAGE/XL Database Management System Reference Manual
Dynamic Data Set Expansion
[REV BEG]
The capacity of non-jumbo (less than or equal to 4 GB in size) master and
detail data sets can be expanded dynamically during DBPUT, or implied
DBPUT for automatic master. The expansion can occur only if the data set
is enabled for dynamic expansion, that is, if the required capacity
parameters are set prior to the expansion.
The capacity parameters are:
* maximum capacity
is a required parameter and is a maximum number of entries the
data set can contain. It must be less than or equal to 231-1
(2,147,483,647). The maximum capacity both for masters and
details is adjusted by TurboIMAGE/XL to represent an even multiple
of the blocking factor.
* initial capacity
is a required parameter and is the initial capacity for the data
set, that is, the number of entries for which space will be
allocated and initialized when the data set is created. For a
master data set, this is also the primary or hashing capacity.
This number must be between 1 and 231 -1 inclusive but must be
less than or equal to the maximum capacity. This parameter should
be used to closely approximate the current volume of data. If it
is very low, there can be frequent expansions leading to severe
disk fragmentation. If it is very high, DBPUT may take a long
time to complete which could impact other database users. The
initial capacity is adjusted to represent an even multiple of the
blocking factor. If initial capacity is not specified, or if
initial capacity is either zero or equal to the maximum capacity,
then dynamic capacity expansion is not enabled for the data set,
and maximum capacity is used for the data set file creation.
* increment
is an optional parameter and is either the number of entries or
the percentage of the initial capacity by which the data set will
be expanded each time its initialized space is exhausted. If a
percentage is used, the percent sign (%) must follow the
incremental amount. This increment parameter can only be used if
the initial capacity parameter is also specified. This number
must be 1 to 32767 inclusive for percent, or 1 to 231 -1
(2,147,483,647) inclusive for number of entries. If it is very
low, there can be frequent expansions leading to severe disk
fragmentation. If it is very high, DBPUT may take a long time to
complete which could impact other database users.
The number of entries defined, or the entries calculated from the
percent, cannot exceed the maximum entry count minus the initial
allocation. That is, the expansion must not result in exceeding
the maximum capacity. The increment is adjusted to represent an
even multiple of the blocking factor. If the increment is not
specified for the data set, or is zero, but the initial capacity
is greater than zero, then the increment for each expansion is
defaulted to ten percent (10%) of the initial capacity for the
data set. If the initial capacity is equal to the maximum
capacity, or the initial capacity is zero, then this indicates the
data set cannot be expanded and increment is ignored.
In brief, a data set is enabled for dynamic expansion when both are true:
* Both maximum capacity and initial capacity are specified
* Initial capacity is neither zero nor equal to the maximum capacity
You can select data sets which need dynamic expansion based on
anticipated growth.
For new databases, the expansion parameters for data sets can be
specified using the CAPACITY statement of DBSCHEMA as follows:
{CAPACITY:}maximum capacity [(blocking factor)][,initial capacity];
{C: } [[,increment] ]
To specify the expansion parameters for data sets of existing databases,
use DBChange Plus, or other third-party tools which support this feature.
In order to use this feature from the user point of view, the only
required step is to identify and enable the data set(s) for dynamic
expansion as described above.
When a data set enabled for dynamic expansion is first created, disk
space for only the initial capacity is allocated and initialized. Later
when the data set is expanded during DBPUT, or implied DBPUT for
automatic master, additional disk space based on the increment is
allocated and initialized. It can grow up to the maximum capacity
specified for the set. Following the expansion, TurboIMAGE/XL updates
various fields related to the expansion such as current capacity
including the expansion and free space counter in the user label.
The instant when the expansion is triggered and how record addresses are
assigned to the new entry vary in detail data sets from master data sets.
Detail Data Sets
For a detail data set, expansion takes place during DBPUT when the free
space counter for the set is zero. Following the expansion,
TurboIMAGE/XL updates the expansion related fields in the user label such
as the end-of-file pointer (high-water mark) and the free space counter.
The expanded data set is perceived as one larger data set and the new
record addresses are assigned using the pointer to delete chain head and
the end-of-file pointer (high-water mark) as done prior to the dynamic
expansion feature. The new entry is assigned the first record address in
the expanded area.
Master Data Sets
For a master data set, expansion is triggered when the set is almost
full. That is, when the set has approximated its maximum capacity which
will not allow DBPUT to be successful. For an example, a DBPUT to a
detail set with multiple paths to the same automatic master will require
multiple record additions to the automatic master.
Once the expansion is done, the master data set can be perceived as
having two areas, original area and expanded area, managed differently.
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 called hashing capacity or initial capacity),
which is 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 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.
[REV END]
MPE/iX 5.5 Documentation