dboo::odb::create_index

void create_index (const cls_id& id, const field_name& fieldname, index_type index_type = index_type::btree, const option_set& options = index_options::default_field_index_options());  // 1)
template<class type>
void create_index (const field_name& fieldname, index_type index_type = index_type::btree, const option_set& options = index_options::default_field_index_options() );  // 2)
template<typename MT, typename C>
void create_index(MT C::* field, index_type index_type = index_type::btree, const option_set& options = index_options::default_field_index_options());   // 3)
create_index(class, field_name)      1)
create_index(class_id, field_name)   2)

Creates a field index.

1

Deletes an index based on class id and field namee

2

Selects named field in class as template parameter

3

Specify field index based on pointer to member

Parameters

id

Name of class

fieldname

Name of field. May be empty to select type index.

field

Pointer to member field

options

The following can be specified:

Option

Explanation

update_after_commit

Index will be updated after the call returns from commit

update_within_commit

Index will be updated before the call returns from commit

update_buffer_limit(bytes)

The size of the update buffer, in number of objects. Objects in the update buffer are included in search but not inserted in btree structure.

cache_size(blocks)

The size of the in-memory cache, in blocks

Return value

(void)

Exceptions

Example