C-Index/II Home Page
|CI2 Home|Literature|Support|Documentation|Y2K|Order|License|
Prev | Next

Fast Performance

C-Index/II delivers fast performance for a wide range of application requirements. This is accomplished through careful coding, unique internal design and API features and adaptability to special applications performance requirement.


Performance Coding

C-Index/II has been written with high performance as a primary objective. With each release, this continues to be an area of improvement. For example, with Release 5.0, random key searching was improved, along with improved files access performance using DENYWRITE file sharing mode.


Internal Design

C-Index/II is based on a standard B+Tree algorithm. The basic technique for creating a B+Tree system is outlined in numerous text books on the subject (such as Knuth "Searching and Sorting"). The design of C-Index/II goes far beyond the plain vanilla algorithm to dramatically improve performance. Just one example: it automatically detects when entries are being added to the end of the file and minimizes the steps required to add the entry into the B+Tree in this case.

Another enhancement includes smart virtual memory buffering which keeps track of the validity of local buffers in a shared file environment. If the local buffer is still valid, it will use the local copy instead of wasting time to request data from the server.

The ReadShare feature improves performance of multi-user access even further. When multiple processes are reading from a file, they all have access to the file simultaneously. Without ReadShare, only one process has access to the file when reading or writing. With ReadShare, C-Index/II is able to read from the file without locking out other processes (provided that no write operation is pending). Since most applications spend the majority of time reading from a file, this can have dramatic improvement in access time.


API Features

C-Index/II includes a number of special API functions to enhance performance. Two examples of these are cnextrep2 and SpeedRead.

The cnextrep2 function is very useful for filling a listbox quickly from an index. It can also be used to speed up index searches that involve a series of next operations. This function retrieves sequentially ordered keys and passes the information for each entry to a callback function provided by the application. This function call can be up to 9 times faster than other methods of reading sequential keys from an index. Customers have reported typical retrieval times of 7000 keys per second.

When the SpeedRead feature is turned on by the application, C-Index/II will try to satisfy any read operations from information that is already in the local virtual memory disk buffers, without performing any file locks or checking if the file has been changed on the server. If the entire read operation cannot be processed from disk buffers, it will retry using the usual method that verifies the status of the buffers, locks the file for reading, and updates the buffers in memory as required.

SpeedRead is especially helpful for improving performance when writing reports in the background. Although the main benefit of SpeedRead is for multi-user access, it will improve the performance of single-user file access as well. An example of the single-user performance improvement can be shown using the testman manual test utility in EXCL mode. With 10,000 entries of 10 bytes each, cnext with SpeedRead turned on is three times faster than cnext with SpeedRead turned off.

Another aspect of performance which is often overlooked is the ability of the database to adapt to special characteristics of the application. Because C-Index/II is so flexible, the developer has a number of options for improving performance. One example: extra information from the record can be attached to the key entry when storing a record with the high-level functions. Using the low-level cnextrep2 function, the application can retrieve a block of keys, and determine which records should be retrieved based on this extra information, eliminating the need to read every record. This can dramatically speed up retrieval time for applications where the nature of the query is known in advance. This is just one example of how high-level and low-level functions can be mixed together to improve performance.


C-Index/II Home Page