Product Documentation

FairCom ISAM for C

Previous Topic

Next Topic

Multi-Page Cache

The c-tree data cache uses the following approach to cache data record images:

  • If the data record fits entirely within one or two cache pages (PAGE_SIZE bytes per cache page), then the entire record is stored in the cache.
  • If the data record image covers more than two cache pages, then the first and last segments of the record are store in the cache, but the middle portion is read from or written to the disk. These direct I/O’s are efficient operations since they are aligned and are for a multiple of the cache page size.

The nature of this approach can be modified. Set the Server keyword MPAGE_CACHE to a value, N, greater than zero, and records that fall within N+2 cache pages will be stored entirely within the cache. The default value is zero, which causes the cache to behave as described above.

Note: Setting MPAGE_CACHE greater than zero does NOT ensure faster system operation. It is more likely to be slower than faster. It does cause more of a record to be in cache, but there is increased overhead managing each individual cache page. The cache pages for consecutive segments of a record (where a segment fills a cache page) are completely independent of each other. They are not stored in consecutive memory and I/O is performed separately for each cache page. This configuration option should only be used for special circumstances with careful, realistic testing.

Note: Even a record smaller than a single cache page may require two cache pages because the record position is generally not aligned on a cache page boundary.

For a bound server, the MPAGE_CACHE configuration parameter is stored in the mpagche member of the ctINIT structure. For Standalone applications, the configuration parameter is stored in the “global” ctmpagcache integer variable. When ctNOGLOBALS is defined, the application instance must be registered before ctmpagcache can be reset. A client cannot affect this value on the Server.