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 05:34:57 +0000
Message-ID: <gh-pgvector-pgvector-810-c2756746679@github.com> (raw)
In-Reply-To: <gh-pgvector-pgvector-810@github.com>
References: <gh-pgvector-pgvector-810@github.com>

> Hi [@xiaojunxiang2023](https://github.com/xiaojunxiang2023), a few questions:
> 
> 1. What values are you using for `m` and `ef_construction`?
> 2. How are you loading the data (single row insert, multi-row insert, text copy, or binary copy)?
> 3. What type of disk are you using?
> 4. What is the schema of the table (including all indexes, foreign keys, etc.)?
> 
> It'd also be helpful to see the output of `EXPLAIN (ANALYZE, BUFFERS)` of a single row insert statement (use `BEGIN; EXPLAIN ...; ROLLBACK;` to prevent the insert from being committed).

  Thank you for your response. 
  I am using index parameters M=64 and efConstruction=128, my pgdata disk is NVME type. And use multi-row insert(the insert sql with 100 rows)

![Image](https://github.com/user-attachments/assets/ad2fe567-0cff-4337-b0cc-dfc5d481fb82)

  I utilized the vectordb-bench benchmarking tool, testing with an empty table containing only the id and embedding fields for data insertion. 
  **This is during the initial run, where each batch of 100 inserts takes around 1.5 seconds.**

![Image](https://github.com/user-attachments/assets/bce75eec-c9d3-42be-88ef-9bad5073fc2f)

  **As the table data increases,** with 16900 rows in the table, **each batch insert now takes around 4 seconds**. **And it keeps getting worse.**

![Image](https://github.com/user-attachments/assets/7e410060-206d-48df-ae7d-7d21cbc564aa)

![Image](https://github.com/user-attachments/assets/55e04be7-6fa2-4086-97f2-f0f1fba7c010)
 
My PostgreSQL Clusterinfo:

![Image](https://github.com/user-attachments/assets/122016d3-7053-44ea-9966-57a2fb8263f3)

![Image](https://github.com/user-attachments/assets/ef9913a9-9134-4a8f-81ed-77e1b000f240)

![Image](https://github.com/user-attachments/assets/b18aa402-0367-452a-9002-04da5d12b14c)

view thread (22+ messages)  latest in thread

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