From: schuemie (@schuemie) <noreply+schuemie@github.com>
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
Subject: [pgvector/pgvector] issue #667: Please add a note to README warning of limitations on Windows
Date: Mon, 09 Sep 2024 06:17:48 +0000
Message-ID: <gh-pgvector-pgvector-667@github.com> (raw)
On Windows, `maintenance_work_mem` cannot be bigger than 2GB, something that is [poorly documented](https://postgrespro.com/list/thread-id/2609309). Because of this, building indices is prohibitively slow for larger vector stores.
In order for others not to have to find this out the hard way like I did, I propose adding a small note to the README that warns people of this. Maybe something like this:
```
NOTE: On Windows, `maintenance_work_mem` is currently limited to 2,024MB at most(up to and including PostgreSQL 16). It might therefore take a prohibitively long time to build indices for large vector stores.
```
Documenting my experience: I created 37 million vectors (PubMed) of 384 dimensions. Loading them in pgvector using bulk loading was quick (< 2 hours). But when I run
```sql
SET maintenance_work_mem = '2047MB'
SET max_parallel_maintenance_workers = 16
CREATE INDEX ON pubmed.vectors_snowflake_arctic_s USING hnsw (embedding vector_cosine_ops)
```
After running for 65 hours, progress is at 74.5%, which is 1% higher than it was 24 hours ago.