pg.ddx.io  pgvector/pgvector GitHub issues and pull requests  
help / color / mirror / Atom feed
From: ankane (@ankane) <noreply+ankane@github.com>
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
Subject: Re: [pgvector/pgvector] issue #916: Unintuitive Query Latency When Filtering
Date: Tue, 28 Oct 2025 17:07:04 +0000
Message-ID: <gh-pgvector-pgvector-916-c3457560079@github.com> (raw)
In-Reply-To: <gh-pgvector-pgvector-916@github.com>
References: <gh-pgvector-pgvector-916@github.com>

Hi @igm503, it looks like very little of the HNSW index is in memory while a decent percentage of the table is in memory (buffers `hit` vs `read`), making the table scan faster (and cost estimation won't account for this).

A few things you can try:

1. Make sure `shared_buffers` is [set correctly](https://github.com/pgvector/pgvector?tab=readme-ov-file#tuning)
2. Add a B-tree index on `paper_id`
3. Use the `halfvec` type (and/or binary quantization with re-ranking) so more of the HNSW index fits into memory
4. Increase memory

view thread (5+ messages)  latest in thread

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