From: ankane (@ankane) <noreply+ankane@github.com>
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
Subject: Re: [pgvector/pgvector] issue #912: Question about hnsw result set size
Date: Thu, 16 Oct 2025 21:04:25 +0000
Message-ID: <gh-pgvector-pgvector-912-c3412840885@github.com> (raw)
In-Reply-To: <gh-pgvector-pgvector-912@github.com>
References: <gh-pgvector-pgvector-912@github.com>
You should also be able to get HNSW to return 25k rows by tweaking a few settings (even without changing `hnsw.ef_search`):
```sql
SET hnsw.iterative_scan = relaxed_order;
SET hnsw.max_scan_tuples = 30000;
SET hnsw.scan_mem_multiplier = 2; -- set higher if needed
```
Feel free to share the output of `EXPLAIN (ANALYZE, SETTINGS)` if that's not the case.