June 30, 2013
KEEP OPEN Your c-treeACE Performance
Note: c-treeACE became FairCom DB in November 2020.
Memory files were designed with the option of remaining open after all users have closed the file. This support was required to avoid losing the contents of the file such that subsequent users can open the file and read and/or update the contents. This mode is referred to as KEEPOPEN.
When a non-memory file is normally physically closed, c‑treeACE removes the data cache and/or index buffer entries associated with the file. A file is physically closed when all users that have the file open close the file.
Allow Files to Remain Open Even When Not Used
This KEEPOPEN support has been extended to all physical ISAM data files and their associated indices. An advantage of this mode is to keep the files in the data cache and index buffers, even after all users have closed the file. Subsequent file opens benefit from having the cache contents immediately available. It also eliminates a physical open when the next user opens the file. This can result in significantly better performance when working with large numbers of files.
Files to be treated in this manner are specified in the server configuration file with one or more entries of the form:
KEEPOPEN_LIST <file spec>
where file <file spec> can be a file name or a partial name including wild card characters.
Upon file creation or physical open, the KEEPOPEN mode is applied to the data file and its indices if:
- the file name matches a <file spec>, and;
- the file is a data file, and;
- the data file creation or open is part of an ISAM creation or open.
If all users have closed a KEEPOPEN file, the ctCLSNAM() API function can be called to close the data file and its associated indices.
- Superfile ISAM members are also supported with this mode. A Superfile host can be created/opened with the KEEPOPENattribute if it is created/opened as an ISAM file (without indices).
If indices are added to an ISAM data file with the KEEPOPEN attribute, then the new indices inherit the KEEPOPENattribute. Regardless of KEEPOPEN attributes, dropped indices are either deleted or renamed depending on their TRANDEPattributes. If the index is renamed (RSTRDEL) then even if the index had KEEPOPEN attributes, the index is physically closed.