15.2.1 Determining the segment size
(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.
Figure 15-1 provides an overview of user RDAREAs depending on the segment size.
Figure 15-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.