On Wed, Sep 17, 2025 at 12:52 PM Tomas Vondra <to...@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