From: huaimin016 (@huaimin016) <noreply+huaimin016@github.com>
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
Subject: [pgvector/pgvector] issue #559: Adding data after building hnsw index is much slower
Date: Thu, 16 May 2024 07:18:27 +0000
Message-ID: <gh-pgvector-pgvector-559@github.com> (raw)
Hello, I found that after creating the hnsw index, adding another piece of data is much slower than before.\
Here's what I did:
1. create table by `CREATE TABLE images (id bigserial PRIMARY KEY, url text, embedding vector(512))`
2. insert 1M data
3. create hnsw index by `CREATE INDEX ON images USING hnsw (embedding vector_cosine_ops)`
After these operations, I added data one by one, adding 100 items, and found that the average adding time was 5-8s. The adding speed before was very fast. Although there was no timer, it was definitely at the millisecond level.
And one more quesetion, when I create hnsw index, query data will also mush slower than before.
So is there a way to solve these two problems? Thanks