11.9 Page access using the snapshot method

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

[Figure]

Organization of this section
(1) Effectiveness of accesses using the snapshot method
(2) Specification
(3) Considerations
(4) Snapshot method applicability

(1) Effectiveness of accesses using 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.

(2) Specification

Specify SNAPSHOT (the default value) in the pd_pageaccess_mode operand.

(3) Considerations

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.

(4) Snapshot method applicability

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

ConditionApplicability
TablesIndexes
Retrievals for which pd_indexlock_mode=KEY is specified in the system common definition, yet the following conditions are not satisfied:
  • WITHOUT LOCK NOWAIT specified for retrieval
  • LOCK TABLE required for retrieval
N/RNo
Retrievals using a holdable cursorNoNo
Retrievals for which the retrieval method is an index scan (INDEX SCAN, MULTI COLUMNS INDEX SCAN)WITHOUT LOCK WAIT is specifiedNoNo
Other than aboveNoYes
Retrievals for which the retrieval method is ROWID FETCHNoN/R
Retrievals with the following columns specified:
  • VARCHAR, MVARCHAR, NVARCHAR columns with a defined length greater than 256 bytes
  • Recursive columns
  • Columns with abstract data types
  • LOB columns
  • Binary columns with a defined length greater than 256 bytes
WITHOUT LOCK WAIT is specifiedNoKey
Other than aboveNoYes
Retrievals for which retrieval conditions specify a hit rate of 1 hit per pageNoNo
Retrievals using a plug-in indexNoNo
Retrievals in a dictionary tableNoNo
Legend:
Yes: Applicable.
No: Not applicable.
Key: Applicable when the retrieval type is a key scan (KEY SCAN, MULTI COLUMNS KEY SCAN).
N/R: Not relevant or condition does not apply.