4 ms·
Remove is supported for some indices. The indexing scheme (IVFPQ, IMI, etc.) is based on the statistics (distribution) of the underlying data. If the statistic
by jhj 10y ago
Remove is supported for some indices.
The indexing scheme (IVFPQ, IMI, etc.) is based on the statistics (distribution) of the underlying data. If the statistics of the new data are not changing much, then it is reasonable to just remove the old vectors and add new ones.
If the distribution changes significantly over time, then rebuilding the index by reclustering would be required. For large enough datasets, one would probably have multiple shards of data that are assumed to be reasonably independent. Individual shards can be periodically reindexed to replace the old shard, but this demands that the original vector data (e.g., 128-dim vectors * sizeof(float) = 512 bytes per vector) is kept around rather than the compressed form (4 - 64 bytes per vector).
As with anything, there is a tradeoff between improving query time versus query accuracy versus preprocessing/index build time versus data storage:
no build time, high query time, high storage, exact accuracy: Faiss IndexFlat
low build time, med query time, high storage, high accuracy: Faiss IndexIVFFlat
med build time, low query time, low-med storage, med-high accuracy: Faiss IndexIVFPQ
very high build time, low query time, low-high storage (whether stored as a k-NN graph or raw data), high accuracy: NN-Descent by Dong et al. (e.g., nmslib)
IndexIVFPQ with perhaps IMI is typically what we concentrate on, seems to be a reasonable sweet spot for billion-scale datasets.
- carlodelmundo 10y agoThanks for the response. Great work here.