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. The following figure provides an overview of the snapshot method.
Figure 11-4 Overview of the snapshot method
The row that first matches the search conditions is copied into process private memory, which allows the retrieval time for the second and subsequent accesses to be shortened. 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 15.1.6(4) Procedure for obtaining the size of the memory required when the snapshot method is used; for a HiRDB/Parallel Server, see 15.2.6(4) Procedure for obtaining the size of the memory required when the snapshot method is used.
The following table indicates whether you need to apply the snapshot method for retrievals.
When No is indicated for applicability, there is no impact on access performance even when SNAPSHOT is specified in the system definition's pd_pageaccess_mode operand. Consequently, the snapshot method is not applicable.
Table 11-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 |