beautypg.com

8 image activation optimization (tru64 unix) – Compaq COBOL AAQ2G1FTK User Manual

Page 515

background image

Optimizing Your Compaq COBOL Program

15.7 Optimizing File Design (OpenVMS)

15.7.3.3 Caching Index Roots

The system requires at least two buffers to process an indexed file: one for a
data bucket, the other for an index bucket. In fact, a data buffer and an index
buffer are needed for every level of indexing available in the file (a fact that is
not visible to the COBOL program, because the minimum amount of space is
always allocated). Each buffer is large enough to contain a single bucket. If your
program does not contain a RESERVE n AREAS clause, or if you do not use the
DCL SET RMS_DEFAULT command, the system sets the default.

A RESERVE n AREAS clause creates additional buffers for processing an indexed
file. At run time, the system retains (caches) in memory the roots of one or more
indexes of the file. Random access to any record through that index requires one
less I/O operation.

You can also use the SET RMS_DEFAULT/BUFFER_COUNT=count to create
additional buffers.

The following rules apply for caching index roots:

Allocate one buffer for each key that your program uses to access file records,
in addition to the two required buffers. For example, if the file contains a
primary key and two alternate keys, and you use all these keys to access
records, allocate a total of five buffers. If you use only one key, you need only
one additional buffer area, or a total of three.

Use the RESERVE n AREAS clause to obtain allocation, where n is two more
than the number of distinct keys used for access. For example, the RESERVE
5 AREAS clause allocates two required buffers, plus three buffer areas for
caching the roots of three distinct file access keys.

Use the DCL SET RMS_DEFAULT/BUFFER_COUNT=count command if you
want to allocate buffers without specifying the RESERVE AREA clause in
your program, or for buffer allocation on a process or systemwide basis.

The DCL SET RMS commands also apply to sequential and relative files. The
DCL SET RMS commands and RESERVE AREA clause provide the same
functionality.

For information about DCL commands, see the OpenVMS DCL Dictionary.

15.8 Image Activation Optimization (Tru64 UNIX)

Shared objects are checksumm(checksu1vour)o(are)-35nU[(DC57tedtiveCOUbuffe52(examplts)-352(areto)-364(access)]TJdo1vour8444.1(do844Forch)-339ly)ymbolvour844wi366(u8r)-e6(u8r)re-dexolve(T)-3330extend-358.188ecksu1our844aImage a