12.10 Global buffer pre-writing
Global buffer pre-writing is a function for reading data from a specified table or index in advance and placing it in the global buffer. Figure 12-5 provides an overview.
Figure 12-5 Overview of global buffer pre-writing
![[Figure]](figure/zu110035.gif)
- Explanation:
- When global buffer pre-writing is not performed
When a UAP accesses a table immediately after HiRDB has started, the UAP reads data from the table because there is no data in the global buffer (physical input/output operations occur). Thereafter, when the UAP accesses this table data, no read operation occurs on those pages that have been written into the global buffer. To access other pages, read operations occur.
- When global buffer pre-writing is performed
The UAP can access the table without having to read data from it because the table data has already been written into the global buffer in advance (no physical input/output operations occur). Thereafter, when the UAP accesses this table, no read operation on the table occurs.
- Organization of this section
- (1) Effects of global buffer pre-writing
- (2) Execution method
- (3) Considerations
(1) Effects of global buffer pre-writing
The buffer hit rate improves because data is read from a specified table or index in advance. By pre-reading a table or index on which many input/output operations are expected immediately after HiRDB starts and prior to starting online applications, you can expect a high buffer hit rate.
(2) Execution method
Specify the table and index to be pre-read and execute the global buffer residence utility (pdpgbfon).
(3) Considerations
- You need more global buffer sectors than the actual number of pages that contain the table or index to be pre-read.
- If there are not enough global buffer sectors, the LRU management method removes the oldest page information from the global buffer (the oldest page in the global buffer accessed according to the pd_dbbuff_lru_option operand value in the system definition). Therefore, executing pdpgbfon serves no purpose when there are not enough global buffer sectors.
- When the global buffer residence utility (pdpgbfon) is used, the prefetch facility takes effect because data is pre-read in the order the pages were stored. When you define the database, you can reduce the execution time by specifying a prefetch count.