12.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. Figure 12-4 provides an overview of the snapshot method.

Figure 12-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

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.

(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 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.

(4) Snapshot method applicability

Table 12-1 describes the applicability of the snapshot method for retrievals.

Table 12-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.