Product Documentation

c-treeDB API API for C

Previous Topic

Next Topic

Field Mask Support Added to c-treeDB API

In V11.6.1 and later, c-treeDB API introduces a new concept used to optimize client/server communication by retrieving only significant record portions - fields - instead of the entire record.

This feature requires a way to specify which of the record's fields are significant and will be accessed. When retrieving a record, c-treeDB API attempts, when possible, to retrieve only the portion that will be accessed. This reduces the number of bytes transmitted. In the case of batches, it increases the number of records retrieved in a single round-trip with a single batch call.

To achieve this objective, we implemented the concept of a "field mask." A field mask defines which are the significant fields. It is activated when the first field is added to the mask. Once active ctdbWriteRecord and ctdbDeleteRecord fail. The field mask cannot be changed when a batch is active. Only the fields specified in the field mask can be accessed using the ctdbGetFieldAs* functions.

New functions:

Previous Topic

Next Topic

Batch column filtering for advanced record retrieval

Using the recently introduced c-treeDB API field mask support, it is now possible to filter columns in batch operations.

In ISAM, set the fldmask member of the PKEYREQ2 structure to be used as a "request" for the BATSETX call, using the BAT_EXTENSIONS mode. The fldmask must point to an array of ULONG sorted in ascending order containing the field number (DODA position) composing the partial record. It is also necessary to set the nfields member to indicate how many entries belong to the fldmask array.

TOCIndex