A_MSSQL_FAST_ACCESS is set from your COBOL program. Files opened while this variable is set to a nonzero value are optimized for forward sequential
access.
This option improves the READ NEXT performance in some cases. For example, benchmark testing yielded the following results
for the READ AND SKIP operation:
No FAST_ACCESS:
|
72.76 seconds
|
FAST_ACCESS, ROWCOUNT 0:
|
148.88 seconds
|
FAST_ACCESS, ROWCOUNT 10:
|
8.09 seconds
|
(10 is the perfect value for ROWCOUNT in this benchmark, because the program does a START, 10 READ NEXT operations, and then
does it again.)
For certain reporting programs, this option can dramatically improve performance. However, please note the following restrictions:
- Files must be open INPUT or open IO with MASS-UPDATE. FAST_ACCESS boosts performance only when no locking is required. In files that allow locking, a record must be reread after being locked;
this prevents an uninterrupted forward sequential traversal.
- Files opened with
FAST_ACCESS use a dedicated connection for reading from the file. Since connections are memory-intensive (both on the client, and on
the server), the number of files opened with
FAST_ACCESS should be kept to a minimum. In the event that opening a connection fails, the file open continues, but
FAST_ACCESS mode is disabled, with the following message appearing in the trace file:
FAST_ACCESS mode not available.
Also, a new connection technically uses a new concurrent Microsoft SQL Server license from Microsoft.
- Files opened with
FAST_ACCESS do not participate in transactions and may even cause the run time system to stop responding if transactions are used, especially
if the
FAST_ACCESS file is updated within the transaction. If you use transactions, do not use
FAST_ACCESS. If you use transactions, use
FAST_ACCESS only for files open INPUT.
- Files opened with
FAST_ACCESS cannot be read backwards. In other words, READ PREVIOUS does not work with FAST_ACCESS files. If you try to READ PREVIOUS
on a file opened with
FAST_ACCESS, an error 9/83 with a secondary code of 20 occurs.
- The ANSI standard states that READ NEXT after a READ returns the next record. Some applications depend on this, and some applications
just want to read dynamically from a file, and don't use the positioning facility. Because of this ambiguity, files that are
opened with
FAST_ACCESS cannot be READ dynamically. If you try to READ on a file opened with
FAST_ACCESS, an error 9/83 with a secondary code of 20 occurs.
There are no restrictions on WRITE, REWRITE, and DELETE. However, these operations use the cursor-based connection, not the
dedicated connection. For this reason, transactions may stop responding.
While the default value is
0 (off,
false,
no), this variable can also take values of
On (true,
yes).