From: ankane (@ankane) <noreply+ankane@github.com>
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
Subject: Re: [pgvector/pgvector] issue #822: HNSW index creation is stuck on dozens millions entries
Date: Mon, 14 Apr 2025 20:01:08 +0000
Message-ID: <gh-pgvector-pgvector-822-c2802853414@github.com> (raw)
In-Reply-To: <gh-pgvector-pgvector-822@github.com>
References: <gh-pgvector-pgvector-822@github.com>
Hi @vitonsky,
1. The slow build time is due to `hnsw graph no longer fits into maintenance_work_mem`. Try removing `LOCAL` from the `SET` commands (`LOCAL` only sets it for the current transaction, and if you're creating the index concurrently, it will be outside of a transaction). You'll also need to increase `max_parallel_workers` if you want to use 11 workers.
2. Using the default `ef_construction` of 64 will build faster.
3. Yes, it's suitable. I'd recommend using the `halfvec` type or binary quantization with re-ranking to reduce the index size.