The environment settings for use of the free space reusage facility are explained in this section.
- Use the pd_assurance_table_no operand to specify the number of tables that will use the free space reusage facility.
For partitioning tables, calculate one table per partition. If the inner replica facility is being used, also calculate the table stored in the replica RDAREA as one table. For a HiRDB/Parallel Server, make the calculation separately for each back-end server, and specify the highest number in this operand.
The free space reusage facility can be used for tables defined by CREATE TABLE or modified by ALTER TABLE up to the number of times (number reserved) specified in the pd_assurance_table_no operand. If an insert is executed on a table for which the number reserved has been reached, the KFPH22030-W message is output, and the free space reusage facility is not applied. In such a case, the free space reusage facility will be applied for all defined tables if you increase the value of the pd_assurance_table_no operand. If the ALTER TABLE statement is specified with ADD RDAREA to add table storage RDAREAs such that the defined number exceeds the reserved number or the number defined for the HiRDB/Parallel Server exceeds the reserved number, free space reusage may or may not be applied to each RDAREA by partitioning tables for which free space reusage is defined.
- Estimate the number of segments to be used for free space reusage (estimate the total number of segments from the total amount of data in the tables; see 17.1 Determining the size of a user RDAREA), and specify the estimated number of segments in the CREATE TABLE definition SQL statement with the SEGMENT REUSE option specified. For tables already created, use the ALTER TABLE statement with the SEGMENT REUSE option specified. The number of segments specified here is applicable to all RDAREAs.
- To change the number of segments once it has been specified, you can specify the number of segments again using ALTER TABLE with the SEGMENT REUSE option specified. HiRDB will process as follows, depending on the page search mode and the value specified for the number of segments:
- When in the new page allocate mode
If the specified number of segments is fewer than the number of used segments, free space reusage will be executed once all free space has disappeared from the last allocated segment.
- When in the free page reuse mode
If the number of segments specified is not greater than the number of used segments, nothing changes. If the number of segments specified is greater than the number of used segments, then once all free space has been used free space reusage will stop briefly, at which point new unused pages will be allocated.
- If there is temporarily a large amount of addition due to such as batch processing, and you want to temporarily stop the free space reusage facility, specify ALTER TABLE with SEGMENT REUSE NO specified. When this is done, the free space reusage facility will stop immediately, and unused segments will be newly allocated.