14.2.1 Determining the segment size
We normally recommend an RDAREA segment size of about one-tenth the RDAREA storage page count. The segment size will be less than one-tenth for large RDAREAs, however, since the maximum segment size is 16,000 pages. This subsection describes the implications of segment size and considerations that should be taken into account when the segment size is selected.
- Organization of this subsection
- (1) Selecting a large segment size
- (2) Selecting a small segment size
- (3) Setting procedure
(1) Selecting a large segment size
- Improved performance
- If row length changes as a result of update processing or if rows are added to a table for which a cluster key is specified, the data input/output time can be reduced because unused pages can be acquired adjacent to the particular page that contains the rows.
- The effects of batch input can be achieved by the prefetch facility because the data in a table is stored in consecutive pages. When the prefetch facility is used, the segment size should be the same as the maximum number of pages for batch input that is specified with the -p option of the pdbuffer operand in the system common definition.
- Note:
- The number of tables and indexes that can be stored per user RDAREA is reduced because the number of segments per RDAREA is reduced.
(2) Selecting a small segment size
- Reduction in required disk space
- The number of unused pages can be reduced because many tables, each containing a small amount of data, can be stored in one user RDAREA.
- Notes
- If a large amount of data is added to a user RDAREA that is based on a small segment size, the segment allocations count increases, thereby increasing overhead.
- Because the number of segments increases, the amount of locked resources also increases when a table is deleted or all rows are deleted from a table.
The following figure provides an overview of user RDAREAs depending on segment size.
Figure 14-1 Overview of RDAREAs depending on segment size
![[Figure]](figure/zu140010.gif)
(3) Setting procedure
The create rdarea statement of the database initialization utility (pdinit) or the database structure modification utility (pdmod) is used to set the segment size.