pg.ddx.io  pgvector/pgvector GitHub issues and pull requests  
help / color / mirror / Atom feed
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. 


![Image](https://github.com/user-attachments/assets/97854aa4-7a18-4b40-a730-6d90580af8fb)



![Image](https://github.com/user-attachments/assets/8b2710c7-f74c-4a49-9ad1-28e83dd184b1)


@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?

view thread (22+ messages)  latest in thread

Message-ID: <gh-pgvector-pgvector-810-c2758402081@github.com>
Permalink:  ../gh-pgvector-pgvector-810-c2758402081@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