15.5.2 Free space reusage facility

The free space reusage facility uses the free space on used pages by switching the page search mode to the free page reuse mode once the number of a table's used segments reaches the number of user-specified segments and those segments have all become full. If there is no free space in any of the specified number of segments, it switches to the new page allocation mode for allocation of a new unused segment.

If the number of segments is not specified, free space is not reused until there are no more unused pages in an RDAREA. When the free space reusage facility is not used, free space is searched for each time from the beginning of the used segments. When the facility is used, the search efficiency is better than when it is not used, because after switching to the free page reuse mode the first time, the search start position is remembered for the subsequent search.

Figure 15-4 provides an overview of the free space reusage facility.

Figure 15-4 Overview of the free space reusage facility

[Figure]

[Figure]

[Figure]

Explanation:
  • When the free space reusage facility is not used
    When there are no more unused pages in the RDAREA, free space to store the data each subsequent time that data is inserted is searched for on used pages from the beginning of the used segments.
  • When the free space reusage facility is used and the number of segments is specified
    If there is an attempt to insert data into a table once the specified number of segments has been reached, an unused segment is not allocated, but instead free space to store the data is searched for in used pages from the beginning of the used segments. The search start position is then remembered for the subsequent search, and searching begins at that position the next time.
  • When the free space reusage facility is used and the number of segments is not specified
    When there is an attempt to insert data when there are no unused pages in the RDAREA, free space to store the data is searched for in used pages from the beginning of the used segments. The search start position is then remembered for the subsequent search, and searching begins at that position the next time.