- Vector Index: Efficiently searches for similar vectors across high-dimensional data (e.g. images, audio, or text embeddings)
- Full-Text Search Index: Enables fast keyword-based searches by indexing words and phrases
- Scalar Index: Accelerates filtering of structured numeric or categorical data
Supported Indexes
The Python
NGram configuration requires a newer client than 0.41.0; see
its SDK requirements.
A deployment builds the vector indexes IVF_FLAT, IVF_PQ, IVF_RQ and
IVF_HNSW_SQ. IVF_SQ, IVF_HNSW_FLAT and IVF_HNSW_PQ are built only by the
embedded library.
Quantization
LanceDB also supports several quantization methods, used by vector indexes to compress vectors and reduce storage requirements:Performance
Vector indexes
If vector search latency climbs with table size (i.e., queries that ran in milliseconds on a small table take seconds as it grows to millions of rows), check whether the query is scanning every vector without an index. The point at which an index helps depends on vector dimensions, hardware and your latency target. Measure your workload before choosing an index. Pick the type by your data shape:
The distance metric is fixed once the index is built. Pick the distance metric based on how the embedding model was trained:
cosine (unnormalized), dot (already-normalized, best performance), l2 (general-purpose, default), hamming (binary). If a query explicitly requests a different metric, the index cannot be used and the query falls back to a brute-force scan; a deployment can be configured to reject that scan on a large table. For parameter tuning, see Vector Indexing.
Scalar indexes
Scalar indexes can reduce the rows scanned for selective filters and speed upmerge_insert key lookups. Start with columns used frequently in those operations,
then use query plans to check whether the index helps. Choose
the index type based on the column’s values:
See Scalar Indexing.
Full-text search
Token positions and retained stop words increase the information stored in a full-text index. Keep the defaults for basic keyword search; enablewith_position=True and retain the needed stop words for phrase queries. See FTS Indexing configuration options for the full set of options.