From: frg01 (@frg01) <noreply+frg01@github.com>
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
Subject: Re: [pgvector/pgvector] issue #720: Can the performance of index creation be improved?
Date: Thu, 28 Nov 2024 13:13:06 +0000
Message-ID: <gh-pgvector-pgvector-720-c2506101118@github.com> (raw)
In-Reply-To: <gh-pgvector-pgvector-720@github.com>
References: <gh-pgvector-pgvector-720@github.com>
> Did increasing the maintenance workers help to speed up the index creation? https://github.com/pgvector/pgvector?tab=readme-ov-file#index-build-time
I learned about the usage of this parameter and practiced it. as follows:
```
SET maintenance_work_mem = '32GB';
SET max_parallel_maintenance_workers = 32;
CREATE INDEX ON pg_vector_collection USING hnsw (embedding vector_cosine_ops) WITH (m = 16, ef_construction = 64);
```
Judging from the CPU situation, it is still only a single postgres process that uses up a single logical processor, and no other logical processors are used.
```
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
2859799 postgres 20 0 480644 387724 155904 R 100.0 0.6 2:12.22 postgres
```
And I learned from this link that this parameter is only for B-tree use
https://postgresqlco.nf/doc/en/param/max_parallel_maintenance_workers/