DuroDBMS API  1.7
Functions
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)
 
RDB_bool RDB_expr_is_serial (const RDB_expression *exp)
 

Detailed Description

#include <rel/rdb.h>

Function Documentation

◆ RDB_create_table_index()

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:
invalid_argument_error
name is not a valid index name.
element_exist_error
An index with name name already exists.
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.

◆ RDB_drop_table_index()

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:
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.