If you need to delete one or mode indexes from a table, perform the following steps:
// delete the first index
CTTable ATable(ADatabase);
// open the table
ATable.Open("MyTable", CTOPEN_NORMAL);
// delete the first index - MyIndex0
ATable.DelIndex("MyIndex0");
// alter the table to commit index changes to disk
try
{
ATable.Alter(CTDB_ALTER_NORMAL);
}
catch (CTExplorer &err)
{
printf("Alter table failed with error %d\n", err.GetErrorCode());
}