Re: Why doesn't GiST VACUUM require a super-exclusive lock, like nbtree VACUUM?

From: Matthias van de Meent <boekewurm+postgres(at)gmail(dot)com>
To: Peter Geoghegan <pg(at)bowt(dot)ie>, Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
Cc: vignesh C <vignesh21(at)gmail(dot)com>, Michail Nikolaev <michail(dot)nikolaev(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Andres Freund <andres(at)anarazel(dot)de>, Tomas Vondra <tomas(at)vondra(dot)me>
Subject: Re: Why doesn't GiST VACUUM require a super-exclusive lock, like nbtree VACUUM?
Date: 2025-04-24 20:46:10
Message-ID: CAEze2WgnHJF66BtviDFNCPy26gLrb+tfns-Bi62DBfReH0-UCg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, 21 Mar 2025 at 17:14, Matthias van de Meent
<boekewurm+postgres(at)gmail(dot)com> wrote:
> Attached is v10, which polishes the previous patches, and adds a patch
> for nbtree to use the new visibility checking strategy so that it too
> can release its index pages much earlier, and adds a similar
> visibility check test to nbtree.

And here's v12. v11 (skipped) would've been a rebase, but after
finishing the rebase I noticed a severe regression in btree's IOS with
the new code, so v12 here applies some optimizations which reduce the
overhead of the new code.

Given its TableAM api changes it'd be nice to have a review on 0001,
though the additions could be rewritten to not (yet) add
TableAMRoutine.

I think patches 1, 2 and 3 are relevant to PG18 (as long as we don't
have a beta, and this is only a bit more than a bugfix). Patch 4 is
for PG19 to get btree to implement the new API, too, and patch 5
contains tests similar to the bitmap scan tests, validating that IOS
doesn't block VACUUM but still returns correct results.

I'll try to figure out a patch that's backpatchable, as alternative to
patches 2 and 3, or at least for back-patching into PG17-. That will
arrive separately, though.

Kind regards,

Matthias van de Meent
Neon (https://neon.tech)

Attachment Content-Type Size
v12-0002-GIST-Fix-visibility-issues-in-IOS.patch application/octet-stream 13.1 KB
v12-0005-Test-for-IOS-Vacuum-race-conditions-in-index-AMs.patch application/octet-stream 16.3 KB
v12-0001-IOS-TableAM-Support-AM-specific-fast-visibility-.patch application/octet-stream 27.4 KB
v12-0004-NBTree-Reduce-Index-Only-Scan-pin-duration.patch application/octet-stream 10.0 KB
v12-0003-SP-GIST-Fix-visibility-issues-in-IOS.patch application/octet-stream 12.4 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2025-04-24 21:43:49 Re: Fix premature xmin advancement during fast forward decoding
Previous Message Alvaro Herrera 2025-04-24 19:36:49 Re: Support NOT VALID / VALIDATE constraint options for named NOT NULL constraints