pg.ddx.io  pgvector/pgvector GitHub issues and pull requests  
help / color / mirror / Atom feed
From: ankane (@ankane) <noreply+ankane@github.com>
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
Subject: Re: [pgvector/pgvector] issue #738: Workers assigned for IVFFlat bottlenecked at 8
Date: Thu, 26 Dec 2024 15:19:35 +0000
Message-ID: <gh-pgvector-pgvector-738-c2562881862@github.com> (raw)
In-Reply-To: <gh-pgvector-pgvector-738@github.com>
References: <gh-pgvector-pgvector-738@github.com>

Hi @huafen17, those settings determine the max number of workers. IVFFlat uses the [default worker calculation](https://github.com/postgres/postgres/blob/REL_17_2/src/backend/optimizer/path/allpaths.c#L4234-L4250) in Postgres, which uses an exponential scale. There's [a branch](https://github.com/pgvector/pgvector/compare/ivfflat-parallel-workers) to change it to match HNSW, but from what I've seen, more workers may not significantly improve build time (so I think the current method is better right now, but happy to see more data).

You can set the exact value with:

```sql
ALTER TABLE test SET (parallel_workers = 31);
CREATE INDEX ...
ALTER TABLE test RESET (parallel_workers);
```

However, this can affect other operations, not just the index build, so I probably wouldn't recommend it outside of testing.

view thread (4+ messages)  latest in thread

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