From: ankane (@ankane) <noreply+ankane@github.com>
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
Subject: Re: [pgvector/pgvector] issue #500: Index Build Time Does Not Improve as Expected When Changing "Workers"
Date: Mon, 25 Mar 2024 21:43:07 +0000
Message-ID: <gh-pgvector-pgvector-500-c2018970349@github.com> (raw)
In-Reply-To: <gh-pgvector-pgvector-500@github.com>
References: <gh-pgvector-pgvector-500@github.com>
If you set `maintenance_work_mem` to a lower value like 100MB, there will be a notice that shows how many tuples fit into that much memory.
```text
NOTICE: hnsw graph no longer fits into maintenance_work_mem after N tuples
DETAIL: Building will take significantly more time.
HINT: Increase maintenance_work_mem to speed up builds.
```
From that, you can extrapolate roughly how much memory it would take to fit the entire graph (and set `maintenance_work_mem` above that if possible).