REBLOCK and REBLOCKFACTOR Options

The REBLOCK and REBLOCKFACTOR options enable you to optimize both random and serial access to a structure; that is, you can maintain two block sizes for the same structure simultaneously, as follows:

  • The smaller block is specified in the BLOCKSIZE option. The Enterprise Database Server uses this block for random access.

  • The larger block size is a multiple of the BLOCKSIZE option value. You specify in the REBLOCKFACTOR option how many times larger the enlarged block should be (for example, a value of 2 for an enlarged block that is twice the size specified in the BLOCKSIZE option). The Enterprise Database Server uses the enlarged block for serial access.

The capability of maintaining two block sizes is called reblocking.

The REBLOCK option controls whether the Accessroutines employs reblocking at run time. Reblocking occurs only when the REBLOCK option is set for the structure. If a structure is not reblocked, all blocks are of the size specified in the BLOCKSIZE option.

The REBLOCK option is reset by default. It is set by specifying REBLOCK or REBLOCK = TRUE.

The most critical choice the user must make for reblocking is the block size. Choosing a block size often requires a trade-off between pack space and core utilization and I/O time. The user should try to minimize block size as much as possible without wasting too much pack space.

The value of the REBLOCKFACTOR option is not as critical as the selection of the block size. The larger the REBLOCKFACTOR option, the less I/O time required for serial users. However, there is a point at which an increase in the REBLOCKFACTOR option does not decrease the overall elapsed time of serial programs. If serial programs are likely to be run when system resources are limited, a smaller REBLOCKFACTOR option value helps minimize core usage.

The REBLOCKFACTOR option is meaningful only if the REBLOCK option is set for the structure. REBLOCKFACTOR is specified as an unsigned integer between 1 and 60, inclusive. The default value for REBLOCKFACTOR is the smaller of either the number 2 or the number of blocks per area. Specifying the value 1 for REBLOCKFACTOR is allowed for compatibility reasons, but might actually cause poorer run-time performance than if REBLOCKFACTOR were not specified.

The REBLOCKFACTOR option is ignored if the REBLOCK option is reset.

If the REBLOCK option is set for a structure but the value of the REBLOCKFACTOR option is not designated, the system computes a default REBLOCKFACTOR value to give a large block size of approximately 1000 words.

Reblocking can be set or reset through the Visible DBS facility for any structure which has the REBLOCK option set in the DASDL description. Both the REBLOCK and REBLOCKFACTOR option can be modified through the Visible DBS facility. This provides the user with a tremendous amount of control over core utilization, especially during critical periods such as high-volume daily access.

The REBLOCK option can be set only when the serial buffers specification is greater than or equal to two. Thus, if the REBLOCK option is TRUE in DASDL and the serial buffers specification is greater than or equal to two, the REBLOCK option is set in the control file; otherwise, it is reset. The BUFFERS specification can be changed through the Visible DBS facility.

If the REBLOCK option is reset in the DASDL description, neither the REBLOCK option nor the REBLOCKFACTOR option can be modified through the Visible DBS facility.

If a program oscillates between serial and random access, the Accessroutines detects this and make it increasingly more difficult for the program to change modes. This prevents spurious readaheads and buffer overlays.

A CREATE statement used at the end-of-file for a fixed format standard data set when the REBLOCK option is set is less efficient than if the REBLOCK option is reset. Hence, this operation is counted as random access and eventually resets the REBLOCK option.

If the EXTENDED attribute is false, locking individual records in the same block causes the Accessroutines to build a linked list of those records. If the REBLOCK option is true, both the number of records per block and the potential length of the linked lists are multiplied by the REBLOCKFACTOR value. If a data set has a large block size and a program modifies a large number of records within one transaction, performance can be negatively affected if a large REBLOCKFACTOR value is used. This reduced performance occurs because the linked list is much larger and the Accessroutines might have to search the entire list, which can increase processor usage. The increase in processor usage because of list searching might outweigh the benefit of fewer IOs. If the LOCK STRUCTURE option can be used instead of individual LOCK statements or the number of locks per transaction can be decreased, the additional processor overhead is virtually eliminated.

The REBLOCK and REBLOCKFACTOR options are valid only for direct and standard data sets.