From: xiaojunxiang2023 (@xiaojunxiang2023) <noreply+xiaojunxiang2023@github.com>
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
Subject: Re: [pgvector/pgvector] issue #810: Inserting into a pgvector table with an HNSW index is very slow, And update more slow
Date: Thu, 27 Mar 2025 15:05:15 +0000
Message-ID: <gh-pgvector-pgvector-810-c2758402081@github.com> (raw)
In-Reply-To: <gh-pgvector-pgvector-810@github.com>
References: <gh-pgvector-pgvector-810@github.com>
> If recall is low, I'd recommend trying `ef_construction` 128, 256, and 512 before trying a higher `m`.
>
> m ef_construction time time / row
> 16 128 24 sec 2.4 ms
> 16 256 30 sec 3.0 ms
> 16 512 45 sec 4.5 ms
When I use "m" = "16", "ef_construction" = "64", "ef_search" = 40, the recall is slow; But when I increased ef_search to 300, the recall rate reached 92%, and I’m very satisfied.
After adjusting the index build parameters, I found that the insert rate has the significant improved, but the update improvement was minimal. Moreover, insert operations were already much faster than updates, and the QPS of updates was just too low.


@ankane In my business, vectors are written using the UPDATE statement, so I am more concerned about the performance of UPDATE. How can this be optimized?