The free space reusage facility is effective when deletion processing ensures that there is always sufficient free space. If there is a search for space when there is not sufficient free space or when there is none at all, the search for free space will constitute a waste of time and resources. It is then necessary to specify more pages per segment, and the facility will have to be stopped. Because a change in the specification of the number of pages per segment requires re-creation (deletion or addition) of the RDAREA, you should consider carefully the number of segments and the segment size when you make your initial design.
- In the following case, the number of segments can be omitted from the SEGMENT REUSE option:
- There is one table in the RDAREA, no indexes are mixed in, and automatic extension is not specified
- In the following cases, the number of segments cannot be omitted from the SEGMENT REUSE option:
- There is one table in the RDAREA, no indexes are mixed in, and automatic extension is specified
- There is one table in the RDAREA, with indexes mixed in
- There are multiple tables in the RDAREA
If the amount of data will increase, specify the number of segments and specify the segment size to be large enough so that deletion will take place in each segment until it becomes full. If the amount of data will not increase, specify the number of segments by estimating the total number of segments that the table will need; there is no need to consider the segment size. However, within the same RDAREA, keep the total number of segments to be reused (if indexes are mixed in, the number of segments to be reused by the tables and the number of segments estimated for the indexes in the same RDAREA) to less than the total number of segments in the RDAREA.
If the free space reusage facility is used on tables for which automatic extension is specified, space extension has priority, and free space reusage is executed once the extended space has reached the specified number of segments.