tibasSpaceDef_AddIndexDef()

Specifies the attributes for a secondary index to be added to the index definitions for the space.

Declaration

tibas_status tibasSpaceDef_AddIndexDef(
    tibasSpaceDef spaceDef,
    tibasIndexDef indexDef)

Parameters

Parameter Description
spaceDef Specifies the spaceDef for the space.
indexDef A tibasIndexDef structure that specifies the attributes for the secondary index.

Remarks

Use the tibasSpaceDef_AddIndexDef() function to add a secondary index for a specified space.

Indexes can speed up the filtering of data when setting up queries and browser filters. When used with shared-nothing persistence, indexes are particularly useful, because they return all matching tuples, including those that have been previously evicted from the space but are stored in persistent storage.

To set up an index definition, you must:

Create an IndexDef object by calling the tibasIndexDef_Create() function and assign the field names used for the index.

Call tibasSpaceDef_AddIndexDef() and specify the IndexDef object that was created by the call to tibasIndexDef_Create().