From: ankane (@ankane) <noreply+ankane@github.com>
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
Subject: Re: [pgvector/pgvector] issue #637: Update neighbors tuple atomically
Date: Tue, 06 Aug 2024 17:11:15 +0000
Message-ID: <gh-pgvector-pgvector-637-c2271759378@github.com> (raw)
In-Reply-To: <gh-pgvector-pgvector-637@github.com>
References: <gh-pgvector-pgvector-637@github.com>
Hi @ron-marcus, this was a design decision. Locking immediately would block page reads for longer during all updates (which blocks index scans and other inserts trying to access the page), with the only benefit of preventing the scenario described above (which is uncommon and has limited impact when it occurs).
Edit: This could be a good place for optimistic locking, but it's not clear it's worth the complexity / performance impact.