pg.ddx.io pgvector/pgvector GitHub issues and pull requests
help / color / mirror / Atom feed[pgvector/pgvector] issue #335: How often if at all re-indexing needs to be done?
8+ messages / 6 participants
[nested] [flat]
* [pgvector/pgvector] issue #335: How often if at all re-indexing needs to be done?
@ 2023-11-03 11:37 "mgoldenbe (@mgoldenbe)" <noreply+mgoldenbe@github.com>
0 siblings, 0 replies; 8+ messages in thread
From: mgoldenbe (@mgoldenbe) @ 2023-11-03 11:37 UTC (permalink / raw)
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
There is a very favorable (for `pgvector`) comparison with Pinecone [here](https://supabase.com/blog/pgvector-vs-pinecone).
However, one thing they did not mention is that the Pinecone algorithm claims to scale more gracefully than HNSW. Here is a quote from [the article](https://www.pinecone.io/blog/hnsw-not-enough/) in the Pinecone blog:
> HNSW was designed for relatively static datasets, though, and production applications are anything but static. As your data changes, so do the vector embeddings that represent your data, and, consequently, so must the vector index. When you make frequent changes to a bolted-on HNSW index, its memory consumption begins to grow… a lot.
> To deal with the growing memory consumption, you would have to do some or all of following:
> - Tolerate increasingly higher query latencies, up until timeouts.
> - Pay high sums of money to avoid those high query latencies.
> - Frequently adjust the HNSW index parameters to maintain query latency despite less available memory, if you have access and expertise to do so.
> - Frequently rebuild the index, and either tolerate downtime during the rebuild process or manage a [blue-green deployment](https://www.redhat.com/en/topics/devops/what-is-blue-green-deployment) each time.
Is what's being said here correct? If so, how does `pgvector` go about the last item? Does it rebuild the index (either actively or lazily)? Should I rebuild the index once in a while? If so, how often?
^ permalink raw [nested|flat] 8+ messages in thread
* Re: [pgvector/pgvector] issue #335: How often if at all re-indexing needs to be done?
@ 2023-11-03 12:12 "jkatz (@jkatz)" <noreply+jkatz@github.com>
6 siblings, 0 replies; 8+ messages in thread
From: jkatz (@jkatz) @ 2023-11-03 12:12 UTC (permalink / raw)
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
I've been doing a lot of testing of HNSW on very large data sets (millions on up), and while it does take more time to insert a vector in an index that has hundreds of millions of vectors, thus far I have not seen any pressing need to re-index. However, I'd qualify that statement as this has been on either known test data sets or simulated vector data.
The HNSW implementation in pgvector also supports updates and deletes, so if you have a record that changes, it will be appropriately reindexed and cleaned up, so you don't have to rebuild it due to that reason.
^ permalink raw [nested|flat] 8+ messages in thread
* Re: [pgvector/pgvector] issue #335: How often if at all re-indexing needs to be done?
@ 2023-11-03 21:30 "ankane (@ankane)" <noreply+ankane@github.com>
6 siblings, 0 replies; 8+ messages in thread
From: ankane (@ankane) @ 2023-11-03 21:30 UTC (permalink / raw)
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
@ankane closed this.
^ permalink raw [nested|flat] 8+ messages in thread
* Re: [pgvector/pgvector] issue #335: How often if at all re-indexing needs to be done?
@ 2023-11-03 21:30 "ankane (@ankane)" <noreply+ankane@github.com>
6 siblings, 0 replies; 8+ messages in thread
From: ankane (@ankane) @ 2023-11-03 21:30 UTC (permalink / raw)
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
To add to @jkatz's answer: the graph is repaired during vacuuming, so no need to reindex.
^ permalink raw [nested|flat] 8+ messages in thread
* Re: [pgvector/pgvector] issue #335: How often if at all re-indexing needs to be done?
@ 2023-12-19 19:17 "JadenGeller (@JadenGeller)" <noreply+JadenGeller@github.com>
6 siblings, 0 replies; 8+ messages in thread
From: JadenGeller (@JadenGeller) @ 2023-12-19 19:17 UTC (permalink / raw)
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
The [FreshDiskANN paper](https://arxiv.org/pdf/2105.09613.pdf) proposes 2 deletion policies for HNSW and determine both are ineffective. I'm wondering if pgvector graph repair uses a different technique that is shown to provide greater recall? Thank you!
^ permalink raw [nested|flat] 8+ messages in thread
* Re: [pgvector/pgvector] issue #335: How often if at all re-indexing needs to be done?
@ 2023-12-20 01:26 "ankane (@ankane)" <noreply+ankane@github.com>
6 siblings, 0 replies; 8+ messages in thread
From: ankane (@ankane) @ 2023-12-20 01:26 UTC (permalink / raw)
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
Hi @JadenGeller, pgvector doesn't use either of those deletion policies. On vacuum, it updates connections for each live element by seeing what the connections would be if the element was freshly inserted. Check out [hnswvacuum.c](https://github.com/pgvector/pgvector/blob/master/src/hnswvacuum.c) for the full approach.
^ permalink raw [nested|flat] 8+ messages in thread
* Re: [pgvector/pgvector] issue #335: How often if at all re-indexing needs to be done?
@ 2024-10-22 17:39 "wahajali (@wahajali)" <noreply+wahajali@github.com>
6 siblings, 0 replies; 8+ messages in thread
From: wahajali (@wahajali) @ 2024-10-22 17:39 UTC (permalink / raw)
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
@ankane @jkatz I modified [VectorDBBench](https://github.com/zilliztech/VectorDBBench) to calculate the recall by deleting and reinserting 10% of the dataset (randomly selected) for OpenAI 500K data on an HNSW index with default values for m, ef_search and ef_construction. I repeated this cycle 20 times, and more or less the recall stayed constant around 0.947. Currently, I don't manually trigger vacuum.
I wanted to ask if this is something to be expect?
^ permalink raw [nested|flat] 8+ messages in thread
* Re: [pgvector/pgvector] issue #335: How often if at all re-indexing needs to be done?
@ 2024-12-24 13:55 "olad32 (@olad32)" <noreply+olad32@github.com>
6 siblings, 0 replies; 8+ messages in thread
From: olad32 (@olad32) @ 2024-12-24 13:55 UTC (permalink / raw)
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
@ankane @jkatz what do you think of this azure team blog post ? https://techcommunity.microsoft.com/blog/adforpostgresql/introducing-diskann-vector-index-in-azure-d...
They introduced a new (closed source) extension using DiskANN, claiming that it overcomes pgvector limitations with filtered query (i assume this is no longer an issue since pgvector 0.8.0) and about a decreased recall after many Insertions, Deletions, and Modifications, are they mislead ?
Is the benchmark made by @wahajali a good proof that their blog statement are wrong ?
^ permalink raw [nested|flat] 8+ messages in thread
end of thread, other threads:[~2024-12-24 13:55 UTC | newest]
Thread overview: 8+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2023-11-03 11:37 [pgvector/pgvector] issue #335: How often if at all re-indexing needs to be done? "mgoldenbe (@mgoldenbe)" <noreply+mgoldenbe@github.com>
2023-11-03 12:12 ` "jkatz (@jkatz)" <noreply+jkatz@github.com>
2023-11-03 21:30 ` "ankane (@ankane)" <noreply+ankane@github.com>
2023-11-03 21:30 ` "ankane (@ankane)" <noreply+ankane@github.com>
2023-12-19 19:17 ` "JadenGeller (@JadenGeller)" <noreply+JadenGeller@github.com>
2023-12-20 01:26 ` "ankane (@ankane)" <noreply+ankane@github.com>
2024-10-22 17:39 ` "wahajali (@wahajali)" <noreply+wahajali@github.com>
2024-12-24 13:55 ` "olad32 (@olad32)" <noreply+olad32@github.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox