Multifetch and Prefetch

How to:

The Adabas Multifetch and Prefetch options reduce execution time and allow Adabas data to be retrieved with a high degree of efficiency. By buffering multiple record results from a single call, Multifetch and Prefetch reduce the communication overhead between the Adapter for Adabas and the Adabas nucleus.

The adapter uses the Multifetch option if it is available (this is the default option), or the Prefetch option if it is available. The option available is determined by your environment.

The adapter trace file contains the following information about the Fetch option:

The Multifetch and Prefetch options require that OPEN=YES (the default value) is specified in the Access File. When OPEN=YES is specified, the Multifetch and Prefetch options are activated. There are two ways to deactivate (or reactivate) these options:

Note: The SET commands override the Access File settings. This setting will be in effect for the entire server session.


Top of page

x
Syntax: How to Set FETCH and FETCHSIZE
x x
ENGINE ADBSINX SET FETCH {ON|OFF|DEFAULT}
ENGINE ADBSINX SET FETCHSIZE {n|MAX[IMUM]}

where:

ADBSINX

Indicates the adapter. You can omit this value if you previously issued the SET SQLENGINE command.

ON

Sets the Fetch feature on for the user session.

OFF

Sets the Fetch feature off for the user session.

DEFAULT

Uses the information from the Access File. DEFAULT is the default value.

n

Is the number of records per buffer (1–32K). The buffer size varies with the size of the record and can be different for each TABLE request. The buffer size limit is 32K. 10 is the default value.

MAX[IMUM]

Is automatically calculated by the Adapter for Adabas to allow the maximum number of records that fit in a 32K buffer.


Top of page

x
Syntax: How to Declare the FETCH and FETCHSIZE Attributes in the Access File

FETCH and FETCHSIZE are applicable only to segments described as ACCESS=ADBS in the Access File.

The Access File can contain the following attributes in the SEGNAM statement

FETCH={ON|OFF}
FETCHSIZE={n|MAX[IMUM]}

where:

ON

Sets the Fetch feature on for the user session. ON is the default value.

OFF

Sets the Fetch feature off for the user session.

n

Is the number of records per buffer (1 to 32k). 10 is the default value.

MAX[IMUM]

Is automatically calculated by the Adapter for Adabas to allow the maximum number of records that fit in a 32K buffer.

Here is an example of the FETCH and FETCHSIZE attributes in the sample Access File for EMPLOYEES:

$$$ FILENAME=EMPFILE1,SUFFIX=ADBSINX,$
RELEASE=6,OPEN=YES,$
 
$ ADABAS FILE = EMPLOYEES                         DICTIONARY =
SEGNAM=S01 ,ACCESS=ADBS,FILENO=001,CALLTYPE=RL,
             SEQFIELD=PERSONNEL_ID,FETCH=ON,FETCHSIZE=15,$ 
FIELD=DEPT_PERSON        ,TYPE=SPR,$
FIELD=DEPT_S03           ,TYPE=DSC,NU=YES,$
FIELD=NAME_S03           ,TYPE=   ,NU=NO,$

See your Software AG documentation for more information about the Multifetch/Prefetch feature.


Information Builders