From: mgoldenbe (@mgoldenbe) <noreply+mgoldenbe@github.com>
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
Subject: [pgvector/pgvector] issue #335: How often if at all re-indexing needs to be done?
Date: Fri, 03 Nov 2023 11:37:10 +0000
Message-ID: <gh-pgvector-pgvector-335@github.com> (raw)
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?