From: kinghuang (@kinghuang) <noreply+kinghuang@github.com>
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
Subject: [pgvector/pgvector] issue #687: Query returns indexed rows with noticeable "steps"; how to control?
Date: Mon, 30 Sep 2024 23:55:26 +0000
Message-ID: <gh-pgvector-pgvector-687@github.com> (raw)
I have pgvector 0.7.2 installed and using hnsw indexes on several tables. Given a `hnsw.ef_search` value like 200, I've noticed that rows come back in noticeable "steps". That is, I get the first 6 rows almost right away, then another 25 rows 2 seconds later, then another 125 rows 8 seconds later, before finally reaching 200.
What causes the rows to be returned in such a pattern? Is it something I can control or optimize for? I've tried fiddling with `hnsw.ef_search` in queries and the `m` and `ef_construction` parameters in indexes, but I always get the bumps at 6, 25, 125, etc.
Edit: The return pattern actually appears to be 1, 5, 25, 125, …. The time between the first row and the next five is miniscule. Didn't notice it at first.