Re: Parallel heap vacuum - Mailing list pgsql-hackers

From Robert Haas
Subject Re: Parallel heap vacuum
Date
Msg-id CA+TgmoaHosc=C9rywziRDyYc-r83MM0v_8_uzPXDKVLMRA4h4Q@mail.gmail.com
Whole thread Raw
In response to Re: Parallel heap vacuum  (Tomas Vondra <tomas@vondra.me>)
List pgsql-hackers
On Wed, Sep 17, 2025 at 12:52 PM Tomas Vondra <tomas@vondra.me> wrote:
> True. And I agree it's not great it might break if we need to setup the
> wal/buffer usage tracking a bit differently (and forget to update all
> the places, or even can't do that in custom AMs).

Exactly.

> I suppose we could wrap that in a helper, and call that? That's what I
> meant by "maybe we could generalize the shmem setup".

Yep, that's one possibility.

> The alternative would be to have a single AM-agnostic place doing
> parallel builds with any index AM, and calls "AM callbacks" instead.
> AFAICS that's pretty much how Melanie imagines the parallel vacuum to
> work (at least that's how I understand it).

And that's the other possibility.

> I'm not sure which way is better. I'm terrible in designing APIs.

I'm not sure either. I don't think I'm terrible at designing APIs (and
you probably aren't either) but I don't know enough about this
particular problem space to be certain what's best.

> For the parallel heap vacuum, the patches seem to be a bit 50:50. The
> per-AM callbacks are there, but each AM still has to do the custom code
> anyway.

Unless I misunderstand, that seems like the worst of all possible situations.

--
Robert Haas
EDB: http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: Masahiko Sawada
Date:
Subject: Re: POC: enable logical decoding when wal_level = 'replica' without a server restart
Next
From: Masahiko Sawada
Date:
Subject: Re: encode/decode support for base64url