From: jkatz (@jkatz) <noreply+jkatz@github.com>
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
Subject: Re: [pgvector/pgvector] issue #877: Slow Inserts with HNSW Index — Is Full Reindexing Occurring?
Date: Tue, 22 Jul 2025 14:55:07 +0000
Message-ID: <gh-pgvector-pgvector-877-c3103194439@github.com> (raw)
In-Reply-To: <gh-pgvector-pgvector-877@github.com>
References: <gh-pgvector-pgvector-877@github.com>
@JWDobken If you'd like an in-depth look for how this works, here's a [recording from the Seattle PostgreSQL User Group](https://www.youtube.com/watch?v=hF556tnKz2M&ab_channel=SeattlePostgresUsersGroup) that goes into detail. (I just gave a recent presentation on this; reminder to get the slides up).
The short answer is that building a HNSW index is an expensive operation. There are techniques to speed this up - preloading the data and the building the index is the fastest way, but if you have to continuously ingest, you'll want to try concurrently inserting or bulk loading. The HNSW method is nice because you can incrementally add to the index with limited impact to the index quality, but the operation to add to the index is expensive.