Skip to content

Indexing Options

We utilize TOML syntax to express the index's configuration. Here's what each key in the configuration signifies:

KeyTypeDescription
segmenttableOptions for segments.
optimizingtableOptions for background optimizing.
indexingtableThe algorithm to be used for indexing.

Options for table segment

KeyTypeRangeDefaultDescription
max_growing_segment_sizeinteger[1, 4_000_000_000]20_000Maximum size of unindexed vectors.
max_sealed_segment_sizeinteger[1, 4_000_000_000]1_000_000Maximum size of vectors for indexing.

Options for table optimizing

KeyTypeRangeDefaultDescription
optimizing_threadsinteger[1, 65535]sqrt of the number of coresMaximum threads for indexing.
sealing_secsinteger[1, 60]60See below.
sealing_sizeinteger[1, 4_000_000_000]1See below.

If a write segment larger than sealing_size do not accept new data for sealing_secs seconds, the write segment will be turned to a sealed segment.

Options for table indexing

KeyTypeDescription
flattableIf this table is set, brute force algorithm will be used for the index.
ivftableIf this table is set, IVF will be used for the index.
hnswtableIf this table is set, HNSW will be used for the index.

You can choose only one algorithm in above indexing algorithms. Default value is hnsw.

Options for table flat

KeyTypeDescription
quantizationtableThe algorithm to be used for quantization.

Options for table ivf

KeyTypeRangeDefaultDescription
nlistinteger[1, 1_000_000]1000Number of cluster units.
nsampleinteger[1, 1_000_000]65536Number of samples for K-Means clustering.
least_iterationsinteger[1, 1_000_000]16Least iterations for K-Means clustering.
iterationsinteger[1, 1_000_000]500Max iterations for K-Means clustering.
quantizationtableThe quantization algorithm to be used.

Options for table hnsw

KeyTypeRangeDefaultDescription
minteger[4, 128]12Maximum degree of the node.
ef_constructioninteger[10, 2000]300Search scope in building.
quantizationtableThe quantization algorithm to be used.

Options for table quantization

KeyTypeDescription
trivialtableIf this table is set, no quantization is used.
scalartableIf this table is set, scalar quantization is used.
producttableIf this table is set, product quantization is used.

You can choose only one algorithm in above indexing algorithms. Default value is trivial.

Options for table product

KeyTypeRangeDefaultDescription
sampleinteger[1, 1_000_000]65535Samples to be used for quantization.
ratioenum"x4", "x8", "x16", "x32", "x64""x4"Compression ratio for quantization.

Compression ratio is how many memory you are saved for saving vectors. For example, "x4" is compared to before. If you are creating indexes on vecf16, "x4" is compared to before.