Re: parallel vacuum comments

From: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
To: "houzj(dot)fnst(at)fujitsu(dot)com" <houzj(dot)fnst(at)fujitsu(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Peter Geoghegan <pg(at)bowt(dot)ie>, Andres Freund <andres(at)anarazel(dot)de>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Subject: Re: parallel vacuum comments
Date: 2021-12-08 23:48:20
Message-ID: CAD21AoAp4oaa5onuZ-DdODJpSX9jZujs3i8ywwQRv+j4jTPiPw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Dec 8, 2021 at 1:37 PM Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com> wrote:
>
> On Wed, Dec 8, 2021 at 12:22 PM houzj(dot)fnst(at)fujitsu(dot)com
> <houzj(dot)fnst(at)fujitsu(dot)com> wrote:
> >
> > On Tuesday, December 7, 2021 1:42 PM Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com> wrote:
> > > I've attached an updated patch. I've removed 0003 patch that added
> > > regression tests as per discussion. Regarding the terminology like "bulkdel"
> > > and "cleanup" you pointed out, I've done that in 0002 patch while moving the
> > > code to vacuumparallel.c. In that file, we can consistently use the terms
> > > "bulkdel" and "cleanup" instead of "vacuum"
> > > and "cleanup".
> > Hi,
> >
> > Thanks for updating the patch.
> > I noticed few minor things.
>
> Thank you for the comments!
>
> >
> > 0001
> > 1)
> >
> > * Skip processing indexes that are unsafe for workers (these are
> > - * processed in do_serial_processing_for_unsafe_indexes() by leader)
> > + * processed in parallel_vacuum_process_unsafe_indexes() by leader)
> >
> > It might be clearer to mention that the index to be skipped are unsafe OR not
> > worthwhile.
>
> Agreed. Will add the comments.
>
> >
> > 2)
> > + /* Set index vacuum status and mark as parallel safe or not */
> > + for (int i = 0; i < pvc->nindexes; i++)
> > + {
> > ...
> > + pindstats->parallel_workers_can_process =
> > + parallel_vacuum_index_is_parallel_safe(vacrel,
> > + vacrel->indrels[i],
> > + vacuum);
> >
> > For the comments above the loop, maybe better to mention we are marking whether
> > worker can process the index(not only safe/unsafe).
>
> Right. WIll fix.
>
> >
> > 0002
> > 3)
> >
> > + /*
> > + * Skip indexes that are unsuitable target for parallel index vacuum
> > + */
> > + if (parallel_vacuum_should_skip_index(indrel))
> > + continue;
> > +
> >
> > It seems we can use will_parallel_vacuum[] here instead of invoking the function
> > again.
>
> Oops, I missed updating it in 0002 patch. Will fix.

I've attached updated patches. Please review them.

Regards,

--
Masahiko Sawada
EDB: https://www.enterprisedb.com/

Attachment Content-Type Size
v6-0002-Move-parallel-vacuum-code-to-vacuumparallel.c.patch application/octet-stream 92.0 KB
v6-0001-Refactor-parallel-vacuum-to-remove-bitmap-related.patch application/octet-stream 36.7 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2021-12-09 00:11:57 Re: cutting down the TODO list thread
Previous Message Thomas Munro 2021-12-08 23:10:23 Re: A test for replay of regression tests