pg.ddx.io  pgvector/pgvector GitHub issues and pull requests  
help / color / mirror / Atom feed
From: vitonsky (@vitonsky) <noreply+vitonsky@github.com>
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
Subject: [pgvector/pgvector] issue #822: HNSW index creation is stuck on dozens millions entries
Date: Mon, 14 Apr 2025 19:34:13 +0000
Message-ID: <gh-pgvector-pgvector-822@github.com> (raw)

It looks i have the similar problem to https://github.com/pgvector/pgvector/issues/689
I did not found answer there, so i file a new issue.

I have partitioned table, every partition contains about 40m rows.

I trying to create index concurrently with `USING hnsw ((embedding::vector(768)) vector_cosine_ops) WITH (m = 16, ef_construction = 200)`

I've set options

```
SET LOCAL maintenance_work_mem = '40GB';
SET LOCAL max_parallel_maintenance_workers = 11;
```

I've got warnings quickly in start of process

```
NOTICE:  hnsw graph no longer fits into maintenance_work_mem after 570905 tuples
DETAIL:  Building will take significantly more time.
HINT:  Increase maintenance_work_mem to speed up builds.
```

Now left about 19 hours and current progress `SELECT phase, round(100.0 * blocks_done / nullif(blocks_total, 0), 1) AS "%" FROM pg_stat_progress_create_index;` command draw is 29.2%

Progress is stuck here at least for 8 hours.

I've checked issues here to find some help, but nothing really useful yet.

I have next questions
- How i can check what's the problem? How to debug pgvector?
- What's your recommendations about indexing?
- Is a pgvector suitable to serve a hundreds of millions or even a billions rows? Or i should use another solution for that?

Third question looks reasonable for me, since my observation is pgvector build index really long time, have problem with long time for vacuum, so database may become unmaintainable if will have large data.

All benchmarks i've seen and blog posts operates over small vectors (128-512 dimensions) and small data samples (few millions) on powerful hardware (sometimes even few terabytes of RAM).

view thread (9+ messages)  latest in thread

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