tibasSpaceDef_SetKeyDef()

Sets the a primary key definition for a specified space.

Declaration

tibas_status tibasSpaceDef_SetKeyDef(
    tibasSpaceDef spaceDef,
    tibasKeyDef keyDef)

Parameters

Parameter Description
spaceDef The TIBCO ActiveSpaces entity on which the function is invoked.
keyDef Specifies a key definition for the SpaceDef.

Remarks

Use the tibasSpaceDef_SetKeyDef() function to set a primary key definition for a specified space.

Using a primary key with the space can dramatically speed up searches, resulting in far fewer reads to locate a tuple.

The keyDef parameter is a keyDef object that has previously been defined by calling the tibasKeyDef_Create() function. The tibasKeyDefCreate() function creates a keyDef object, assigns the fields used as a primary index, and by default, assigns the index for the primary key the value TIBAS_INDEX_HASH. You can use the tibasKeyDef_SetIndexType() function to change the index to TIBAS_INDEX_TREE if you want to use a tree index.