Product Documentation

c-treeDB API for C++ - Developers Guide

Previous Topic

Next Topic

CTIndex::SetKeyType

Set the index key type.

Declaration

void CTIndex::SetKeyType(CTDBKEY keytype)

Description

CTIndex::SetKeyType() sets the key type for this index. Use CTIndex::Add() to add an index to a table. Use the CTIndex:GetKeyType() to retrieve the Index key type.

  • KeyType [in] the key type

Valid keytype values are:

  • CTINDEX_FIXED: Fixed-length key
  • CTINDEX_LEADING: Leading-character compression
  • CTINDEX_PADDING: Padding compression
  • CTINDEX_LEADPAD: Leading and padding compression

Note: Key compression imposes a significant performance impact, especially when deleting records. Use this feature only when absolutely necessary to keep index space requirements to a minimum.

Return

SetKeyType() does not return a value but will throw an exception if the index key type cannot be set.

See "c-treeDB Errors and Return Values" for a complete listing of valid c-treeDB error codes and return values.

See Also

CTIndex::GetKeyType(), CTIndex::Add()

TOCIndex