Re: Parallel heap vacuum

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tomas Vondra <tomas(at)vondra(dot)me>
Cc: Melanie Plageman <melanieplageman(at)gmail(dot)com>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, Peter Smith <smithpb2250(at)gmail(dot)com>, John Naylor <johncnaylorls(at)gmail(dot)com>, "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Parallel heap vacuum
Date: 2025-09-17 17:17:30
Message-ID: CA+TgmoaHosc=C9rywziRDyYc-r83MM0v_8_uzPXDKVLMRA4h4Q@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Sep 17, 2025 at 12:52 PM Tomas Vondra <tomas(at)vondra(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2025-09-17 17:51:35 Re: encode/decode support for base64url
Previous Message Masahiko Sawada 2025-09-17 16:53:37 Re: POC: enable logical decoding when wal_level = 'replica' without a server restart