In single-file CDFs an indexing scheme is used to keep track of where a variable's records are located within the .cdf file. The order that variable (and attribute entry) values are written to a single-file CDF by an application may result in a variable's records being noncontiguous. There will be groups of contiguous records, but these groups will not be contiguous. This section will give a brief overview of how a variable's records are indexed.
For each variable in a single-file CDF one or more index records will exist.
Each of these index records will contain one or more index
entries.
An index entry consists of the following fields:
The number of the first record in a group of contiguous records.
The number of the last record in a group of contiguous records.
The byte offset within the .cdf file of the group of contiguous records.
To find a particular variable record the CDF library must search through the index entries for that variable. Improved performance will result if there are fewer index entries to search. This can be achieved by having a large number of records in each group of contiguous records (resulting in fewer groups/index entries). Even better would be only one group of contiguous records per variable. Techniques used to achieve fewer index entries are described in the ``Allocated Records'' and ``Extend Records'' subsections of Section 2.3.8.
It is possible to inquire the indexing statistics for a variable. Using the Internal Interface, an application may inquire the number of index records and total number of index entries for rVariables and zVariables using the <GET_,rVAR_nINDEXRECORDS> , <GET_,rVAR_nINDEXENTRIES> , <GET_,zVAR_nINDEXRECORDS> , and <GET_,zVAR_nINDEXENTRIES> operations.