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