From: igm503 (@igm503) <noreply+igm503@github.com>
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
Subject: Re: [pgvector/pgvector] issue #916: Unintuitive Query Latency When Filtering
Date: Sun, 02 Nov 2025 17:17:46 +0000
Message-ID: <gh-pgvector-pgvector-916-c3478121459@github.com> (raw)
In-Reply-To: <gh-pgvector-pgvector-916@github.com>
References: <gh-pgvector-pgvector-916@github.com>
@ankane Thanks for the response.
1. This helped overall speed, but it remains the case that the query planner still makes very bad decisions about whether to use HNSW or a naive scan when the filter set is ~1% of the total gallery (that is, I still see HNSW being outperformed by naive scan even when much more of the index is in memory than in the previous example)
2. I've got that.
3. I've since tried going down to Binary, and still see the same problem! (it just shifts what gallery % and n_returned parameters where the "bad" decisions happen)
Is there any predictable way I can intervene in query execution to force it to force postgres not to use the HNSW index for some queries? That would kind of solve my problem. I've done some searching, and haven't found a way to do this.