create index

create index <index_name>  [--index_type=btree | hashmap] [--update_order=within_commit | after_commit] [--update_buffer=<value> | default] [--cache_size] [--property]

Creates a type or field index. This command requires connection to a user database.

Arguments

Argument

Values

Explanation

index_name

name of type or member field

Options

Option

Values

Explanation

–index_type, -t

btree, hashmap

the type of index, btree or hashmap

–update_order, -u

within_commit, after_commit

order of updates

–update_buffer, -f

<value>, default

size of buffer before on disk structure is updated

–cache_size, -cs

size of cache

–property, -p

set any property (key:value)

Example

tomas@tomsmbp:~/ > dboo example_queries -u=example_user -p=password
dboo example_user@example_queries> list indices --field_indices
Customer [hashmap]: 7 objects, 0 bytes (0B): good
Product [hashmap]: 6 objects, 0 bytes (0B): good
  Field indices:
  Product::_price (dboo::double) [btree]: 6 objects, 12288 bytes (0B): good
Purchase [hashmap]: 100 objects, 0 bytes (0B): good

# Create index
dboo example_user@example_queries> create index --index_type=btree Product::_name

dboo example_user@example_queries> list indices --field_indices
Customer [hashmap]: 7 objects, 0 bytes (0B): good
Product [hashmap]: 6 objects, 0 bytes (0B): good
  Field indices:
  Product::_name (dboo::string) [btree]: 6 objects, 12288 bytes (0B): good
  Product::_price (dboo::double) [btree]: 6 objects, 12288 bytes (0B): good
Purchase [hashmap]: 100 objects, 0 bytes (0B): good
tomas@tomsmbp:~/ > dboo example_queries -u=example_user -p=password -- create index --index_type=btree Product::_name