How SB buffers data
The following sections describe what sequential buffering (SB) does, including what SB buffers, how and when SB is activated, and what happens to the data that SB buffers.
What SB buffers
HD databases can consist of multiple data set groups. A database PCB can therefore refer to several data set groups. A database PCB can also refer to several data set groups when the database referenced by the PCB is involved in logical relationships. A particular database, and therefore a particular data set group, can be referenced by multiple database PCBs. A specific data set group that is referenced by a specific database PCB is referred to in the following sections as a DB-PCB/DSG pair.
When SB is activated, it buffers data from the OSAM data set associated with a specific DB-PCB/DSG pair. SB can be active for several DB-PCB/DSG pairs at the same time, but each pair requires a separate activation.
If you use OSAM SB with a HALDB database, because each database can have multiple partitions, HALDB DB-PCB/DSG pairs are further qualified by partition IDs. The SB blocks that are created for a HALDB partition cannot be shared among application program PSTs.
Periodic evaluation and conditional activation of SB
IMS does not immediately activate SB when you request it. Instead, when SB is requested for a program, IMS begins monitoring the I/O reference pattern and activity rate for each DB-PCB/DSG pair that is used by the program. After awhile, IMS performs the first of a series of periodic evaluations of the buffering process. IMS performs periodic evaluations for each DB-PCB/DSB pair and determines if the use of SB would be beneficial for the DB-PCB/DSG pair. If the use of SB is beneficial, IMS activates SB for the DB-PCB/DSG pair. This activation of SB is known as conditional activation.
After SB is activated, IMS continues to periodically evaluate the I/O reference pattern and activity rate. Based on these evaluations, IMS can take either of the following actions:
- Temporarily deactivate SB and continue to monitor the I/O reference pattern and activity rate. Temporary deactivation is implemented to unfix and page-release the SB buffers.
- Temporarily deactivate monitoring of the I/O reference pattern and activity rate. This form of temporary deactivation is implemented only if SB is deactivated and IMS concludes from subsequent evaluations that use of SB would still not be beneficial.
When SB is temporarily deactivated, it can be reactivated later based on the results of subsequent evaluations.
Individual periodic evaluations are performed for each DB-PCB/DSG pair. Therefore, IMS can deactivate SB for one DB-PCB/DSG pair while SB remains active for other DB-PCB/DSG pairs.
Role of the SB buffer handler
When SB is activated for a DB-PCB/DSG pair, a pool of SB buffers is allocated to the pair. Each SB buffer pool consists of n buffer sets (the default is four) and each buffer set contains 10 buffers. These buffers are used by an internal component that is called the SB buffer handler to hold the sets of 10 consecutive blocks that are read with sequential reads.
While SB is active, all requests for database blocks not found in the OSAM buffer pool are sent to the SB buffer handler. The SB buffer handler responds to these requests in the following way:
- If the requested block is already in an SB buffer, a copy of the block is put into an OSAM buffer.
- If the requested block is not in an SB buffer, the SB buffer handler analyzes a record of previous I/O requests and decides whether to issue a sequential read or a random read. If it decides to issue a random read, the requested block is read directly into an OSAM buffer. If it decides to issue a sequential read, the requested block and nine adjacent blocks are read into an SB buffer set. When the sequential read is complete, a copy of the requested block is put into an OSAM buffer.
- The SB buffer handler also decides when to initiate overlapped sequential reads.