pg.ddx.io  pgvector/pgvector GitHub issues and pull requests  
help / color / mirror / Atom feed
From: Manuelreyesbravo (@Manuelreyesbravo) <noreply+Manuelreyesbravo@github.com>
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
Subject: Re: [pgvector/pgvector] PR #1020: Prefetch unvisited neighbors during HNSW search
Date: Tue, 06 Oct 2026 15:03:07 +0000
Message-ID: <gh-pgvector-pgvector-1020-c6019118745@github.com> (raw)
In-Reply-To: <gh-pgvector-pgvector-1020@github.com>
References: <gh-pgvector-pgvector-1020@github.com>

Agreed -- with the `read_stream_pause` fix they're even at the default eic, and
the read stream gets AIO and the I/O accounting from core, which the manual
prefetch here can't. That's the better base, so I'm happy to close this in
favor of it.

The look-ahead (prefetching the next candidates' unvisited neighbors out of
what's left of the eic budget after the hop's own reads) does seem worth
having, so yes -- please send it separately on top, and I'm glad to help test
and review it. The wasted prefetches are real but bounded to the spare budget,
so it comes down to whether the extra reads pay off at a given eic; your
numbers (about 8% more reads for ~12% less time at eic 64, and nothing at
eic 16 where the budget is already spent) are the right way to decide that.

Reusing the read stream across layers (hnsw-read-stream4) makes sense too --
keeping the distance warm so it only ramps up once per layer instead of once
per hop.

Thanks for digging into this with me.


view thread (15+ messages)  latest in thread

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