Product Documentation

V9 Update Guide

Previous Topic

Next Topic

Advanced Cache Alternative for Scanning Data Files

The data cache and index buffer pages are managed using a least-recently-used (LRU) scheme such that the page that has not been touched the longest will be the page selected for re-assignment when a page is required to satisfy a current request. For indices, this simple strategy works very well since traversing an index tree frequently requires access to the same, important high level nodes (such as the root node) and/or to the “current” leaf node.

For data files, the LRU scheme is not always effective. In particular, when data file access or updates involve many different records with little or no revisiting of records once they have been processed, the LRU scheme can result in many cache pages to be assigned to recently accessed records. But, at least from the user’s perspective, there is little chance of revisiting these pages.

To address these situations, FairCom has devised an alternative cache strategy that provides an efficient new method of accessing the cache. The ctSCANCACHEhdr mode allows this new caching strategy.

The new strategy uses all the standard cache routines except when requiring a cache page (that is, c-tree has not found the data block it needs already in cache), it uses one of two dedicated cache pages.

The significance of this strategy is that a large set of data record operations can be performed with only two cache pages with little or no decrease in performance compared to no restrictions on cache usage. Moreover, such restricted use may help other aspects of system performance since the bulk of data cache can be used for other files and/or other users. A large traversal of the data file will not replace other cache pages.

The following call will enable the scanner mode of the file to use the new cache strategy:

PUTHDR(datno, YES, ctSCANCACHEhdr);

TOCIndex