ctdbSetDefaultIndex
Set the number of the new default index.
Declaration
CTDBRET ctdbSetDefaultIndex(CTHANDLE Handle, NINT indexno)
Description
ctdbSetDefaultIndex() sets the number of the new default index. Use ctdbGetDefaultIndex() to retrieve the table default index. Initially, the default index is the first index created during the table definition.
To force a physical data table traversal without using any indexes, specify the following constant:
If not disabled during the table creation, two default indexes are created during the table definition, besides the indexes defined by the user. These indexes may be used to sort the table, and they are:
See the discussion on Hidden fields regarding these two indexes.
Use ctdbSetDefaultIndexByName() to set the table default index by name.
Returns
ctdbSetDefaultIndex() returns CTDBRET_OK on success, or FairCom DB API C API error code on failure.
See also
ctdbAllocRecord(), ctdbSetTableDefaultIndexExtentSize(), ctdbGetDefaultIndex(), ctdbSetDefaultIndexByName()