Re: Add parallelism and glibc dependent only options to reindexdb

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Julien Rouhaud <rjuju123@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, Kevin Grittner <kgrittn@gmail.com>
Date: 2019-07-02T02:49:28Z
Lists: pgsql-hackers
On Mon, Jul 01, 2019 at 06:28:13PM +0200, Julien Rouhaud wrote:
> On Mon, Jul 1, 2019 at 4:10 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Couldn't we make this enormously simpler and less bug-prone by just
>> dictating that --jobs applies only to reindex-table operations?

I had the same argument about the first patch sets actually, but... :)

> That would also mean that we'll have to fallback on doing reindex at
> table-level, even if we only want to reindex indexes that depends on
> glibc.  I'm afraid that this will often add a huge penalty.

Yes, I would expect that most of the time glibc-sensible indexes are
also mixed with other ones which we don't care about here.  One
advantage of the argument from Tom though is that it is possible to
introduce --jobs with minimal steps:
1) Refactor the code for connection slots, without the cell addition
2) Introduce --jobs without INDEX support.

In short, the conflict business between indexes is something which
could be tackled afterwards and with a separate patch.  Parallel
indexes at table-level has value in itself, particularly with
CONCURRENTLY coming in the picture.
--
Michael

Commits

  1. Add support for --jobs in reindexdb

  2. Remove more progname references in vacuumdb.c

  3. Refactor parallelization processing code in src/bin/scripts/