pg.ddx.io  pgvector/pgvector GitHub issues and pull requests  
help / color / mirror / Atom feed
From: chmaurer (@chmaurer) <noreply+chmaurer@github.com>
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
Subject: [pgvector/pgvector] issue #912: Question about hnsw result set size
Date: Thu, 16 Oct 2025 20:02:37 +0000
Message-ID: <gh-pgvector-pgvector-912@github.com> (raw)

I have been playing around a few days and I cannot wrap my head around that issue. I already found the issue/section in the README about iterative scans (https://github.com/pgvector/pgvector/issues/776) as well as feature requests to have more than 1000 results on hsnw's ef_search paramter (https://github.com/pgvector/pgvector/issues/865). Anyhow, I still don't know how to proceed on this:

- I have an application which strictly requires us to deliver back 25.000 rows from the database. Reasons are involved, but we need to do a cosine search and return 25k candidates.
- I tried with hnsw but ran into the limitation that ef_search can only return 1000 rows. 
- I tried with ivfflat, but playing with the lists of the index (currently 1000, because I have 1.3 mio rows), the ivfflat.probes (currently 100), and ivfflat.max_probes (150) did not change a lot. I always seem to get a "random" number of results.

The query I try to execute is `SELECT id, vector, payload
                FROM boardid_data
                ORDER BY (vector <=> %s) ASC
                    LIMIT %s;`

where I pass in a vector as string and the limit parameter (25000 obviously). The index performs nicely (if it is not used, retrieval is above 1 minute, with the index <= 3 sec), but the number of candidates varies. 

I have also tried to `SET ivfflat.iterative_scan = relaxed_order;`, but this didn't help either. Also, I have created the index when 1.3 mio rows were filled. Is there any way to constantly get ivfflat index to return 25k candidates?

view thread (6+ messages)  latest in thread

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