Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved


Chapter 10 IndexDef : IndexDef Operations : tibasIndexDef_Create()

tibasIndexDef_Create()
Function
Declaration
tibas_status tibasIndexDef_Create(
tibasIndexDef* indexDef,
char*          indexName,
char*          fieldNames)
Purpose
Creates a secondary index definition.
Parameters
 
Remarks
Use the tibasIndexDef_Create() function to create a secondary index.
Secondary indexes provide a way to search for data that supplements the primary index that you create with the tibasKeyDef_Create()function. Indexes are built when spaces are created (or loaded) and use memory to help locate matching tuples faster than it takes to iterate through a long record. Secondary indexes can speed up searches significantly.
By default, tibasIndexDefCreate() assigns the index type for the index the value TIBAS_INDEX_HASH. You can use the tibasIndexDef_SetIndexType() function to change the index to TIBAS_INDEX_TREE if you want to use a tree index.
After you create the index by calling tibasIndexDef_Create(), you must add it to the spaceDef for the space by calling the tibasSpaceDef_AddIndexDef()function. Then, when you join a space, you pass the spaceDef to the tibasMetaspace_DefineSpace() function.
See Also
tibasIndexDef_SetName(), tibasIndexDef_SetIndexType(), tibasIndexDef_SetFieldNames()tibasIndexDef_Free(), tibasSpaceDef_AddIndexDef(), tibasMetaspace_DefineSpace()

Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved