Re: parallel vacuum comments

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
Cc: Andres Freund <andres(at)anarazel(dot)de>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Peter Geoghegan <pg(at)bowt(dot)ie>
Subject: Re: parallel vacuum comments
Date: 2021-11-02 09:27:28
Message-ID: CAA4eK1J5-DXGJNOEXY1ifaVoYuVBdsxriTqChQe6Pb7hzN81Mg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Nov 1, 2021 at 7:15 AM Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com> wrote:
>
> On Sun, Oct 31, 2021 at 6:21 AM Andres Freund <andres(at)anarazel(dot)de> wrote:
>
> > - Imo it's pretty confusing to have functions like
> > lazy_parallel_vacuum_indexes() (in 13, renamed in 14) that "Perform index
> > vacuum or index cleanup with parallel workers.", based on
> > lps->lvshared->for_cleanup.
>
> Okay. We need to set lps->lvshared->for_cleanup to tell worker do
> either index vacuum or index cleanup. So it might be better to pass
> for_cleanup flag down to the functions in addition to setting
> lps->lvshared->for_cleanup.
>

But, we need this information in the parallel worker as well to know
whether to perform index vacuum or clean up, so I guess we need this
information in shared memory, no?

> >
> >
> > - I don't like some of the new names introduced in 14. E.g.
> > "do_parallel_processing" is way too generic.
>
> I listed the function names that probably needs to be renamed from
> that perspecti:
>
> * do_parallel_processing
> * do_serial_processing_for_unsafe_indexes
> * parallel_process_one_index
>
> Is there any other function that should be renamed?
>
>
> > - On a higher level, a lot of this actually doesn't seem to belong into
> > vacuumlazy.c, but should be somewhere more generic. Pretty much none of this
> > code is heap specific. And vacuumlazy.c is large enough without the parallel
> > code.
>
> I don't come with an idea to make them more generic. Could you
> elaborate on that?
>

Can we think of moving parallelism-related code to a different file
(say vacuumparallel.c)? At least that will reduce the footprint of
vacuumlazy.c.

--
With Regards,
Amit Kapila.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Shinoda, Noriyoshi (PN Japan FSIP) 2021-11-02 09:31:33 RE: Improve logging when using Huge Pages
Previous Message Alexander Pyhalov 2021-11-02 09:12:07 Re: Partial aggregates pushdown