As new records are written to a variable, additional records are allocated at the end of that variable. For CDFs with the multi-file format, only the records actually needed are appended to the corresponding variable file. The records always remain contiguous (allowing the location of a record to be determined very efficiently).
For single-file CDFs, however, the new records are allocated at the end of the .cdf file. The new records may not be located contiguously with the other records for the variable. This results in a new entry being created in the indexing scheme (see Section 2.2.7) used to locate variable records. The indexing scheme is more efficient if fewer entries are needed (resulting from larger blocks of contiguous records being allocated). The CDF library attempts to optimize the indexing scheme by allocating more records than are actually needed with the assumption that they will eventually be used. A minimum number of records to allocate is maintained for each variable.
Because an application knows how records will be added to a variable more so than the CDF library, the Internal Interface may be used to explicitly specify the number of records to extend a variable when necessary. This only has an effect on CDFs with the single-file format and for variables that are not NRV (since at most only one physical record will ever be written for an NRV variable).
Note the distinction between records allocated and records actually written. The CDF library may allocate more records than are actually written by an application for the reasons stated above. When an application inquires the number of records for a variable, the number written, not the number allocated, will be returned by the CDF library.
Extend records are specified for rVariables/zVariables using the <PUT_,rVAR_EXTENDRECS_> and <PUT_,zVAR_EXTENDRECS_> operations of the Internal Interface.