When retrieval is performed but facilities designed to improve performance (such as the rapid grouping facility) cannot be applied, the global buffers are accessed several times to retrieve rows that satisfy the retrieval conditions. With the snapshot method, all rows in the buffer that match the retrieval conditions are copied into the process private memory the first time they are accessed, and when the same pages are accessed subsequently the retrieval result is returned by referencing the process private memory. Figure 12-4 provides an overview of the snapshot method.
Figure 12-4 Overview of the snapshot method
Because the rows that match the conditions of a retrieval request are copied into the process private memory at the time of the first access, retrieval time for subsequent accesses is reduced. The number of times that the global buffers are accessed is also reduced, preventing a concentration of accesses on the global buffer.
Specify SNAPSHOT (the default value) in the pd_pageaccess_mode operand.
When the snapshot method is specified for use, the process private memory is maintained automatically on the basis of the page size of the RDAREA where the table or index is stored. For details about calculating the size of the maintained process private memory for a HiRDB/Single Server, see 16.1.6(4) Procedure for obtaining the size of the memory required when the snapshot method is used; for a HiRDB/Parallel Server, see 16.2.6(5) Procedure for obtaining the size of the memory required when the snapshot method is used.
Table 12-1 describes the applicability of the snapshot method for retrievals.
Table 12-1 Applicability of the snapshot method for retrievals
Condition | Applicability | ||
---|---|---|---|
Tables | Indexes | ||
Retrievals for which pd_indexlock_mode=KEY is specified in the system common definition, yet the following conditions are not satisfied:
| N/R | No | |
Retrievals using a holdable cursor | No | No | |
Retrievals for which the retrieval method is an index scan (INDEX SCAN, MULTI COLUMNS INDEX SCAN) | WITHOUT LOCK WAIT is specified | No | No |
Other than above | No | Yes | |
Retrievals for which the retrieval method is ROWID FETCH | No | N/R | |
Retrievals with the following columns specified:
| WITHOUT LOCK WAIT is specified | No | Key |
Other than above | No | Yes | |
Retrievals for which retrieval conditions specify a hit rate of 1 hit per page | No | No | |
Retrievals using a plug-in index | No | No | |
Retrievals in a dictionary table | No | No |