From: | Andres Freund <andres(at)anarazel(dot)de> |
---|---|
To: | Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com> |
Cc: | Melanie Plageman <melanieplageman(at)gmail(dot)com>, Peter Smith <smithpb2250(at)gmail(dot)com>, John Naylor <johncnaylorls(at)gmail(dot)com>, Tomas Vondra <tomas(at)vondra(dot)me>, "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-07-21 23:49:09 |
Message-ID: | 6zyyuyh2rxyxlqbe66leahw436umfaazctcjnc7gcbov5btpma@mqjiwtzy2sbi |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Hi,
On 2025-07-21 12:41:49 -0700, Masahiko Sawada wrote:
> The reason why I added some callbacks as table AM callbacks in the
> patch is that I could not find other better places. Currently,
> vacuumparallel.c handles several critical operations for parallel
> vacuuming: allocating and initializing DSM space for parallel index
> vacuuming, initializing and launching parallel workers, and managing
> various auxiliary tasks such as configuring vacuum delays and setting
> maintenance_work_mem for workers. Given these existing
> functionalities, I aimed to implement the parallel heap vacuum worker
> launch through the same vacuumparallel.c codebase, maintaining a
> consistent interface. To achieve this integration, vacuumparallel.c
> requires access to heap-specific functions, and defining them as table
> AM callbacks emerged as the cleanest solution.
I don't think that can be the right solution. Vacuuming is a table-am specific
operation and thus already happens within a table-am's own code. It would be
rather wrong to have tableam.h indirected calls below heapam specific code.
That is not to say you can't have callbacks or such, it just doesn't make
sense for those callbacks to be at the level of tableam. If you want to make
vacuumparallel support parallel table vacuuming for multiple table AMs (I'm
somewhat doubtful that's a good idea), you could do that by having a
vacuumparallel.c specific callback struct.
Greetings,
Andres Freund
From | Date | Subject | |
---|---|---|---|
Next Message | Corey Huinker | 2025-07-22 00:16:12 | Re: teach pg_upgrade to handle in-place tablespaces |
Previous Message | Masahiko Sawada | 2025-07-21 23:33:13 | Re: POC: enable logical decoding when wal_level = 'replica' without a server restart |