Re: parallel vacuum comments

From: Andres Freund <andres(at)anarazel(dot)de>
To: pgsql-hackers(at)postgresql(dot)org, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, Peter Geoghegan <pg(at)bowt(dot)ie>
Subject: Re: parallel vacuum comments
Date: 2021-12-11 05:32:24
Message-ID: 20211211053224.c7rjms3r7mnh4b3z@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2021-10-30 14:21:01 -0700, Andres Freund wrote:
> Due to bug #17245: [1] I spent a considerably amount of time looking at vacuum
> related code. And I found a few things that I think could stand improvement:

While working on the fix for #17255 (more specifically some cleanup that Peter
suggested in the context), I noticed another thing: Initializing parallelism
as part of dead_items_alloc() is a bad idea. Even if there are comments noting
that oddity.

I don't really see why we should do it this way? There's no "no-parallelism"
path in begin_parallel_vacuum() besides compute_parallel_vacuum_workers(). So
it's not like we might just discover the inability to do parallelism during
parallel initialization?

It's also not particularly helpful to have a begin_parallel_vacuum() that
might not actually begin a parallel vacuum...

Minor nit:

begin_parallel_vacuum()'s comment says:
* On success (when we can launch one or more workers), will set dead_items and
* lps in vacrel for caller.

But it actually doesn't know whether we can start workers. It just checks
max_parallel_maintenance_workers, no?

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2021-12-11 06:09:57 Re: Add client connection check during the execution of the query
Previous Message Andres Freund 2021-12-11 05:11:01 Re: Add client connection check during the execution of the query