Index functions


Functions

int RDB_create_table_index (const char *name, RDB_object *tbp, int idxcompc, const RDB_seq_item idxcompv[], int flags, RDB_exec_context *ecp, RDB_transaction *txp)
int RDB_drop_table_index (const char *name, RDB_exec_context *ecp, RDB_transaction *txp)

Detailed Description

#include <rel/rdb.h>

Function Documentation

int RDB_create_table_index ( const char *  name,
RDB_object tbp,
int  idxcompc,
const RDB_seq_item  idxcompv[],
int  flags,
RDB_exec_context *  ecp,
RDB_transaction *  txp 
)

RDB_create_table_index creates an index with name name for the table specified by tbp over the attributes specified by idxcompc and idxcompv. The flags argument must be either 0 or RDB_ORDERED. If flags is 0, a hash index is created. If flags is RDB_ORDERED, a B-tree index is created.

Functions which read tuples from a table (like RDB_table_to_array and RDB_extract_tuple) try to use available indexes to achieve better performance.

Returns:
RDB_OK on success, RDB_ERROR if an error occurred.

Errors:
RDB_INVALID_ARGUMENT_ERROR
name is not a valid index name.
RDB_ELEMENT_EXIST_ERROR
An index with name name already exists.
RDB_NAME_ERROR
An attribute specified by idxcompv does not appear in the table.

The call may also fail for a system error, in which case the transaction may be implicitly rolled back.

int RDB_drop_table_index ( const char *  name,
RDB_exec_context *  ecp,
RDB_transaction *  txp 
)

RDB_drop_table_index drops the index specified by name.

Returns:
RDB_OK on success, RDB_ERROR if an error occurred.

Errors:
RDB_NOT_FOUND_ERROR
An index with name name does not exist.

The call may also fail for a system error, in which case the transaction may be implicitly rolled back.


Generated on Tue Mar 11 23:48:15 2008 for Duro by  doxygen 1.5.1