Re: [HACKERS] Block level parallel vacuum - Mailing list pgsql-hackers

From Mahendra Singh Thalor
Subject Re: [HACKERS] Block level parallel vacuum
Date
Msg-id CAKYtNAqY4sXPOau=NeBtsUX3UMn4cndi7_4Q9jH_MBDboaAhzQ@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] Block level parallel vacuum  (Amit Kapila <amit.kapila16@gmail.com>)
Responses Re: [HACKERS] Block level parallel vacuum  (Amit Kapila <amit.kapila16@gmail.com>)
List pgsql-hackers
On Sat, 4 Jan 2020 at 07:12, Amit Kapila <amit.kapila16@gmail.com> wrote:
>
> On Fri, Jan 3, 2020 at 10:15 PM Robert Haas <robertmhaas@gmail.com> wrote:
> >
> > On Sun, Dec 29, 2019 at 4:23 PM Tomas Vondra
> > <tomas.vondra@2ndquadrant.com> wrote:
> > > IMO there's not much reason for the leader not to participate. For
> > > regular queries the leader may be doing useful stuff (essentially
> > > running the non-parallel part of the query) but AFAIK for VAUCUM that's
> > > not the case and the worker is not doing anything.
> >
> > I agree, and said the same thing in
> > http://postgr.es/m/CA+Tgmob7JLrngeHz6i60_TqdvE1YBcvGYVoEQ6_xvP=vN7DwGg@mail.gmail.com
> >
> > I really don't know why we have that code.
> >
>
> We have removed that code from the main patch.  It is in a separate
> patch and used mainly for development testing where we want to
> debug/test the worker code.
>

Hi All,

In other thread "parallel vacuum options/syntax" [1], Amit Kapila asked opinion about syntax for making normal vacuum to parallel.  From that thread, I can see that people are in favor of option(b) to implement.  So I tried to implement option(b) on the top of v41 patch set and implemented a delta patch.

How vacuum will work?

If user gave "vacuum" or "vacuum table_name", then based on the number of parallel supported indexes, we will launch workers.
Ex: vacuum table_name;
or vacuum (parallel) table_name;    //both are same.

If user has requested parallel degree (1-1024), then we will launch workers based on requested degree and parallel supported  indexes.
Ex: vacuum (parallel 8) table_name;

If user don't want parallel vacuum, then he should set parallel degree as zero.
Ex: vacuum (parallel 0) table_name;

I did some testing also and didn't find any issue after forcing normal vacuum to parallel vacuum.  All the test cases are passing and make check world also passing.

Here, I am attaching delta patch that can be applied on the top of v41 patch set. Apart from delta patch, attaching gist index patch (v4) and all the v41 patch set.

Please let me know your thoughts for this.

[1] : https://www.postgresql.org/message-id/CAA4eK1LBUfVQu7jCfL20MAF%2BRzUssP06mcBEcSZb8XktD7X1BA%40mail.gmail.com

--
Thanks and Regards
Mahendra Singh Thalor

Attachment

pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Refactor parse analysis of EXECUTE command
Next
From: Dean Rasheed
Date:
Subject: Re: Errors when update a view with conditional-INSTEAD rules