Product Documentation

Knowledgebase

Previous Topic

Next Topic

TRNLOG Transaction Files with LOGIDX Indexes

TRNLOG indexes can optionally be created with the LOGIDX attribute. This attribute causes the server to log index reorganization operations to the transaction logs in order to facilitate automatic recovery of large indexes.

During automatic recovery, FairCom DB scans the transaction logs in order to determine which TRNLOG index files must be processed by automatic recovery. For TRNLOG index files that were not created with the LOGIDX attribute, the server scans the leaf nodes, verifying links and rebuilding the upper part of the index tree. For large indexes, scanning the leaf nodes can be time-consuming.

Creating TRNLOG indexes with the LOGIDX attribute allows the server to make local repairs to index nodes (made possible by the additional LOGIDX transaction log entries) rather than requiring a full index leaf node scan, verification, and reconstruction. For this reason, using LOGIDX indexes can significantly speed up recovery time in the case of large TRNLOG indexes.

Using the LOGIDX attribute for an index file causes FairCom DB to perform the following additional steps for index reorganization operations on that index:

  • Write begin/end entries to the transaction log for index reorganizations (i.e., node splits or underflow node recovery). Before the “end” entry is written to the log, the index updates are saved to disk. If a begin is found without a corresponding end during automatic recovery, then the index must be examined in the region of the reorganization.
  • Write vulnerable node entries to the transaction log to identify nodes which must be cleaned during automatic recovery. It is not necessary to place images of nodes in the log. Instead, the server logs the node position and optionally a key value which identifies the node’s logical position in the index.

In This Section

Properties of LOGIDX Index Files

When to Use LOGIDX Index Files

Creating and Using LOGIDX Index Files

Previous Topic

Next Topic

Properties of LOGIDX Index Files

The format of a TRNLOG index created with the LOGIDX attribute is identical to that of a TRNLOG index created without the LOGIDX attribute. The only difference is the generation of additional log entries for index reorganization operations, which automatic recovery uses to speed recovery of the indexes as described above.

Previous Topic

Next Topic

When to Use LOGIDX Index Files

The LOGIDX attribute is appropriate to use when a database contains large TRNLOG indexes and the application requires fast automatic recovery. The tradeoff for faster automatic recovery is that using LOGIDX might introduce a slight performance penalty for index update operations due to the generation of additional log entries and forced flushing of updated index buffers.

Previous Topic

Next Topic

Creating and Using LOGIDX Index Files

To create a TRNLOG index file with LOGIDX support enabled, include the TRNLOG and LOGIDX filemodes in the filemode value specified when creating the index file.

  • If using an ISAM-level file creation function, include TRNLOG | LOGIDX in the ifilmod field of the IFIL structure supplied to the function.
  • If using a low-level file creation function, include TRNLOG | LOGIDX in the filemode parameter supplied to the function.

Because LOGIDX affects only the server’s transaction processing behavior and does not affect the format of the index file, LOGIDX can be enabled at run-time for all TRNLOG indexes by specifying the following server configuration option in the server configuration file, ctsrvr.cfg:

FORCE_LOGIDX ON

The FORCE_LOGIDX keyword provides a simple way to enable LOGIDX processing for TRNLOG indexes, including those that were not created with the LOGIDX attribute. When this option is specified in the server configuration file, all TRNLOG indexes are treated as LOGIDX files. Using this keyword is a good way to ensure that LOGIDX processing is in effect for all TRNLOG indexes in order to ensure fast recovery.

TOCIndex