As you add new data to your LanceDB tables, your indexes may become outdated. Reindexing is the process of updating the index to account for new data — this applies to either a full-text search (FTS) index or a vector index. Reindexing is an important operation to run periodically as your data grows, as it has performance implications. As data is being added and a reindex operation is running, LanceDB will combine results from the existing index with exhaustive/flat search on the new data. This is done to ensure that you’re still retrieving results over all your data, but it does come at a performance cost. The more data that you add without reindexing, the impact on latency (due to exhaustive search) can be noticeable. Rather than dropping an existing index entirely and reindexing from scratch, LanceDB supports incremental indexing.Documentation Index
Fetch the complete documentation index at: https://docs.lancedb.com/llms.txt
Use this file to discover all available pages before exploring further.
Incremental Reindexing
You can manually trigger an incremental indexing operation on updated data using theoptimize() method on a table.
Table optimization performs three maintenance operations:
- Compaction: merges small fragments into larger ones to improve read performance
- Pruning/Cleanup: removes files from versions older than a retention window (7 days by default)
- Index update: adds newly-ingested data to existing indexes
- While indexes are being rebuilt, queries use brute force methods on unindexed rows, which may temporarily increase latency. To avoid this, set
fast_search=Trueto search only indexed data. - Use
index_stats()to view the number of unindexed rows. This will be zero when indexes are fully up-to-date.