Second-most desirable block

When it is not possible to store one or more segments in the most desirable block because, for example, space is not available, the HD space search algorithm searches for the second-most desirable block or CI.

This search is done only if the block is in the buffer pool or contains free space according to the bitmap. The second-most desirable block or CI is a block or CI that was left free when the database was loaded or reorganized.

You can specify that every nth block or CI be left free. If you do not specify that every nth block or CI be left free, the HD space search algorithm does not search for the second-most desirable block or CI.

For HDAM or HIDAM databases, you can enter your free space specifications by using the FRSPC= keyword in the DATASET macro of the DBDGEN utility.

For PHDAM or PHIDAM databases, you can enter your free space specifications for each partition separately in the DBRC RECON data set by using either the HALDB Partition Definition utility or the FBFF(value) and FSPF(value) parameters of the DBRC batch commands INIT.PART or CHANGE.PART.

All search ranges defined in the HD space search algorithm, excluding steps 9 and 10, are limited to the physical extent that includes the most desirable block. When the most desirable block is in the overflow area, the search ranges, excluding steps 9 and 10, are restricted to the overflow area.

The steps in the HD space search algorithm follow. They are arranged in the sequence in which they are performed. The first time any one of the steps in the list results in available space, the search is ended and the segment is stored.

The HD space search algorithm looks for space in the following order:

  1. In the most desirable block (this block or CI is in the buffer pool).
  2. In the second-most desirable block or CI.
  3. In any block or CI in the buffer pool on the same cylinder.
  4. In any block or CI on the same track, as determined by consulting the bitmap. (The bitmap says whether space is available for the longest segment type defined.)
  5. In any block or CI on the same cylinder, as determined by consulting the bitmap.
  6. In any block or CI in the buffer pool within plus or minus n cylinders. Specify n in the SCAN= keyword in the DATASET statement in the DBD.

    For HALDB databases, the value of the SCAN= keyword is always 0.

  7. In any block or CI plus or minus n cylinders, as determined by consulting the bitmap.
  8. In any block or CI in the buffer pool at the end of the data set.
  9. In any block or CI at the end of the data set, as determined by consulting the bitmap. The data sets will be extended as far as possible before going to the next step.
  10. In any block or CI in the data set where space exists, as determined by consulting the bitmap. (This step is not used when a HIDAM or PHIDAM database is loaded.)

Some of the above steps are skipped in load mode processing.

If the dependent segment being inserted is at the highest level in a secondary data set group, the place and the way in which space is found differ: