pg.ddx.io pgvector/pgvector GitHub issues and pull requestshelp / color / mirror / Atom feed
[pgvector/pgvector] issue #998: Allow index only scan in queries that require other table fields 3+ messages / 2 participants [nested] [flat]
* [pgvector/pgvector] issue #998: Allow index only scan in queries that require other table fields @ 2026-07-10 12:08 "xcu (@xcu)" <noreply+xcu@github.com> 0 siblings, 0 replies; 3+ messages in thread From: xcu (@xcu) @ 2026-07-10 12:08 UTC (permalink / raw) To: pgvector/pgvector <noreply+pgvector-pgvector@github.com> From what I understand a query that needs something other than the distances (i.e `SELECT mytable.id, mytable.other_field, mytable.embedding <-> [embedding] LIMIT 10;` ) will be forced to go to disk because HNSW and IVF indexes only keep the TID for each row, so that forces Postgres to go to the heap and retrieve the associated values. This can be problematic for big tables, because you already have a fairly big index in memory, so having to get the associated TID will likely result in a higher memory footprint as you not only have to keep the HNSW/IVF index in memory, but also the actual table. This results in more disk reads and worse latency. Is this something that you have in the roadmap? I'm not that knowledgeable about Postgres internals to understand what effort would be required. I suppose even keeping only the table PK in the index would be enough. ^ permalink raw [nested|flat] 3+ messages in thread
* Re: [pgvector/pgvector] issue #998: Allow index only scan in queries that require other table fields @ 2026-07-10 20:02 "ankane (@ankane)" <noreply+ankane@github.com> 1 sibling, 0 replies; 3+ messages in thread From: ankane (@ankane) @ 2026-07-10 20:02 UTC (permalink / raw) To: pgvector/pgvector <noreply+pgvector-pgvector@github.com> Hi @xcu, it'd be great to support index-only scans (and isn't difficult to implement), but there isn't a performance benefit with the current behavior of the Postgres executor (which is why it currently isn't supported). - https://github.com/pgvector/pgvector/issues/359#issuecomment-1840786021 - https://www.postgresql.org/message-id/flat/2ca5865b-4693-40e5-8f78-f3b45d5378fb%40iki.fi ^ permalink raw [nested|flat] 3+ messages in thread
* Re: [pgvector/pgvector] issue #998: Allow index only scan in queries that require other table fields @ 2026-07-10 20:02 "ankane (@ankane)" <noreply+ankane@github.com> 1 sibling, 0 replies; 3+ messages in thread From: ankane (@ankane) @ 2026-07-10 20:02 UTC (permalink / raw) To: pgvector/pgvector <noreply+pgvector-pgvector@github.com> @ankane closed this. ^ permalink raw [nested|flat] 3+ messages in thread
end of thread, other threads:[~2026-07-10 20:02 UTC | newest] Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2026-07-10 12:08 [pgvector/pgvector] issue #998: Allow index only scan in queries that require other table fields "xcu (@xcu)" <noreply+xcu@github.com> 2026-07-10 20:02 ` "ankane (@ankane)" <noreply+ankane@github.com> 2026-07-10 20:02 ` "ankane (@ankane)" <noreply+ankane@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