Scalable Database Server, HiRDB Version 8 Description
Table 4-2 lists and describes the statuses that are assigned to segments.
Table 4-2 Segment statuses
Segment status | Description |
---|---|
Used segment* | A segment in which table or index data is stored. A used segment that is completely filled with data such that no more can be added is called a full segment, and a used segment from which data has been deleted so that only free pages remain (used free pages or unused pages) is called a used free segment. |
Unused segment | A segment that is not being used. This segment can be used by any table or index in the RDAREA. |
Free segment | A segment in which no data is stored. Both used free segments and unused segments are called free segments. |
Segments must be designed with care, because the segment size (number of pages per segment) affects I/O times and disk space requirements. The recommended segment size for most purposes is 10-20 pages. For details about segment design, see the HiRDB Version 8 Installation and Design Guide.
When you define a table, you can specify the ratio of free pages in a segment. This concept is illustrated in Figure 4-2.
Figure 4-2 Ratio of free pages in a segment
The data storage efficiency improves as the segment free page ratio becomes smaller.
Increasing the segment free page ratio sometimes improves performance. For example, when data is added to a table for which a cluster key is defined and a segment free page ratio has been set, you can cause data to be stored in positions that are near a cluster key value, which minimizes the number of data I/O operations that will be needed.
For details about determining the segment free page ratio, see the HiRDB Version 8 Installation and Design Guide.
Segments are not allocated when the table is defined. Instead, segments are allocated as needed when data is saved to the table. Once a segment is allocated (once it becomes a used segment), no other table or index can use that segment until it is released. Consequently, the RDAREA may run out of free space if data is added and deleted repeatedly, even though the amount of data has not increased. To prevent this from occurring, periodically perform the following operations to release segments:
For details about reorganizing tables and indexes, and about releasing used free segments, see the HiRDB Version 8 System Operation Guide. In addition to these operations, the following operations also release segments:
The free space reuse facility enables you to efficiently utilize free space made available by deleting data.
When data is saved to a table, there are two page search modes that are used to search for a storage area:
The free space reuse facility is designed to enable the free space in used pages to be utilized by activating the free page reuse mode. This occurs when the number of used segments in a table reaches the number of segments specified by the user, and the last segment becomes full. Once the free space in every segment of the specified number of segments runs out, the free space reuse facility activates the new page allocate mode, and a new unused segment is allocated. If the number of segments is not specified, free space is not reused until there are no more unused pages in the RDAREA. If the free space reuse facility is not used, the system searches for free space from the beginning of the used segment every time a search is performed. If the free space reuse facility is used, the free page reuse mode is activated, the next search start position is remembered, and the next search is performed from there. As such, use of this facility enables searches to be performed more efficiently. Figure 4-3 provides an overview of the free space reuse facility.
Figure 4-3 Overview of the free space reuse facility
For details about the free space reuse utility, see the HiRDB Version 8 System Operation Guide.
For operations requiring frequent reorganization, use the free space reuse facility to absolutely minimize the number of reorganizations you need to perform, especially when repeated deletions and insertions of data are using up large numbers of segments.
The following environment settings are used for the free space reuse facility. For details, see the HiRDB Version 8 Installation and Design Guide.
The free space reuse facility does not operate in the following cases:
All Rights Reserved. Copyright (C) 2007, Hitachi, Ltd.