Specifying a Free Space Segment Size
Specifying FSS makes better use of the free space in full-function databases because you can specify a different value than the one used by the IMS space management search algorithm. When inserting segments in a database, IMS space management uses a bit map and space search algorithm to determine where space is available. Each database has one or more bit map blocks for each data set group, and each bit in a bit map indicates whether there is free space in a corresponding block.
If the block has at least one free space element (FSE) large enough to hold the largest segment in that data set group, the bit map indicates that there is space in a block. The segment length used for a segment with an edit/compression routine is the largest segment length, plus 10 bytes, plus the segment prefix. The segment length used for a variable length segment is the maximum bytes parameter specified in the database description (DBD), plus 10 bytes, plus the segment prefix.
Using the largest segment size to determine the availability of free space creates problems when the following situations occur:
- A segment with edit/compression compresses to a size considerably smaller than the largest (uncompressed) segment length, plus 10 bytes, plus the segment prefix.
- One segment size is substantially different than all others in that data set group.
- The average variable length segment size is substantially less than the maximum bytes parameter specified in the DBD.
For example, if you have a database in which the largest segment is defined in the DBD as 2,000 bytes and the segment is compressed, there would have to be 2,010 bytes (plus the segment prefix) of contiguous space in a block before the bit map would indicate that space was available. If (in that database) the typical segment compresses to an average of 100 bytes, blocks with less than 2,010 bytes (plus the segment prefix) of free space that could be used to insert segments would not be used.
By specifying FSS for your databases, however, you can indicate that segments less than the largest segment size be inserted into the free space areas. On these typical 100 byte segments, for example, the bit map value of 2,010 can be overridden by specifying FSS value of 100 bytes plus the segment prefix. This resets the bit map to indicate that space is available if 100 or more bytes plus the segment prefix are free. IMS is forced to use space it would otherwise not consider.
When FSS is specified, the bit map may reflect space available when, in fact, the space available is not large enough to hold the segment being replaced or inserted. IMS resets the appropriate bit in the bit map and looks for another block. Unfortunately, IMS must do another I/O to read the other block.
You can minimize this disadvantage by knowing which segment types are added to the database most frequently and what the average length of those segments is. The Trial Compression Analysis report, which is shown in Trial-Compression-Analysis-report, gives you the average segment length. To select an appropriate FSS value, calculate the average size of updated compressed and noncompressed segments in the database. Then add the size of the segment prefix. For database partitions, one FSS value will apply to all partitions.
For the bit map to reflect the specified FSS value, the database must be loaded after FSS is specified in the DPICDS. The FSS value can be changed at any time and, as the bit map is updated, the new value is used. To implement the FSS, you must perform a database reorganization with the unload being expanded; otherwise, the FSS goes into effect at the next database reorganization.
You can specify FSS during online or batch registration.