From: jitokim (@jitokim) <noreply+jitokim@github.com>
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
Subject: Re: [pgvector/pgvector] PR #1026: HNSW: don't rewind insertPage to deleted slots that cannot fit the element
Date: Fri, 25 Sep 2026 00:42:52 +0000
Message-ID: <gh-pgvector-pgvector-1026-c5824712916@github.com> (raw)
In-Reply-To: <gh-pgvector-pgvector-1026@github.com>
References: <gh-pgvector-pgvector-1026@github.com>
Thanks for the feedback, @ankane. Reproduced: after VACUUM, a few large inserts move insertPage to the tail and small inserts stop reusing the freed slots (+1,259 pages vs +10 on master, 50k rows).
The tries-bounded latch keeps reuse, but repeat large inserts still scan to the end of the index (`049` fails), since insertPage only moves ~4 pages per insert.
Pushed a version that bounds the scan instead: after 3 pages whose deleted slots are all too small, jump to the last page and leave insertPage unchanged. Reuse matches master, large inserts stay near baseline, and `050` covers your case. Numbers are in #1025.
That said, FSM sounds like the better fix. Happy to close this if you go that way.