From: Waterpine (@Waterpine) <noreply+Waterpine@github.com>
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
Subject: Re: [pgvector/pgvector] PR #1058: Improved performance of IVFFlat index scans
Date: Tue, 17 Nov 2026 23:23:17 +0000
Message-ID: <gh-pgvector-pgvector-1058-c6963968288@github.com> (raw)
In-Reply-To: <gh-pgvector-pgvector-1058@github.com>
References: <gh-pgvector-pgvector-1058@github.com>
Thanks, @ankane. I tested the local patch on PostgreSQL 16.15 with 1.05M synthetic 16-dimensional vectors, `lists = 1025`, `ivfflat.probes = 32`, and `LIMIT 10`. The patch gives tuplesort half of `work_mem`, with a 64 kB minimum.
| `work_mem` | Paired rounds | Baseline | Patched | Mean latency change |
| --- | ---: | ---: | ---: | ---: |
| 4 MB (default, both in memory) | 4 | 28.918 ms | 8.816 ms | −69.51% |
| 128 kB (both spill) | 16 | 39.897 ms | 40.153 ms | +0.64% |
Each round ran 100 queries per build with matched random seeds and alternating build order. At 128 kB, `EXPLAIN (ANALYZE, BUFFERS)` confirmed temporary reads and writes for both builds.
Dropping the two largest and two smallest paired latency differences leaves an average slowdown of 0.198 ms (about 0.5%).
These results are from one machine with prewarmed data. The memory-budget change is still local.