Re: parallel vacuum - few questions on docs, comments and code

From: Dilip Kumar <dilipbalaut(at)gmail(dot)com>
To: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Subject: Re: parallel vacuum - few questions on docs, comments and code
Date: 2021-05-12 05:26:38
Message-ID: CAFiTN-sva3oGy=Tsmtzzd_jkDESPVU8QjAU-x+SQtRhaS=Sk4Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, May 11, 2021 at 5:38 PM Bharath Rupireddy
<bharath(dot)rupireddyforpostgres(at)gmail(dot)com> wrote:
>
> Hi,
>
> I was going through the parallel vacuum docs and code. I found below
> things, please someone clarify:
>
> 1) I see that a term "parallel degree" is used in the docs, code
> comments, error messages "parallel vacuum degree must be a
> non-negative integer", "parallel vacuum degree must be between 0 and
> %d". Is there any specific reason to use the term "parallel degree"?
> In the docs and code comments we generally use "parallel workers".

I think using "parallel workers" will be more consistent.

> 2) The error messages "parallel vacuum degree must be between 0 and
> %d" and "parallel option requires a value between 0 and %d" look
> inconsistent.

+1

> 3) Should the Assert(nindexes > 0); in begin_parallel_vacuum just be
> Assert(nindexes > 1); as this function is entered only when indexes
> are > 1?
> 4) IIUC, below comment says that even if PARALLEL 0 is specified with
> VACUUM command, there are chances that the indexes are vacuumed in
> parallel. Isn't it a bit unusual that a user specified 0 workers but
> still the system is picking up parallelism? I'm sure this would have
> been discussed, but I'm curious to know the reason.
> * nrequested is the number of parallel workers that user requested. If
> * nrequested is 0, we compute the parallel degree based on nindexes, that is
> * the number of indexes that support parallel vacuum.
> 5) Can the parallel_workers in below condition ever be negative in
> begin_parallel_vacuum? I think we can just have if (parallel_workers
> == 0).
> /* Can't perform vacuum in parallel */
> if (parallel_workers <= 0)

Yes it should if (parallel_workers == 0)

> 8) Is it still true that if parallel workers are specified as 0 the
> parallelism will not be picked up?
> From the docs: This feature is known as parallel vacuum. To disable
> this feature, one can use PARALLEL option and specify parallel workers
> as zero.

Yes, by default this is enabled so for disabling user need to give
PARALLEL as 0.

--
Regards,
Dilip Kumar
EnterpriseDB: http://www.enterprisedb.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Kyotaro Horiguchi 2021-05-12 05:33:35 Re: compute_query_id and pg_stat_statements
Previous Message Etsuro Fujita 2021-05-12 05:15:38 Re: Asynchronous Append on postgres_fdw nodes.