Re: Add parallelism and glibc dependent only options to reindexdb - Mailing list pgsql-hackers

From Julien Rouhaud
Subject Re: Add parallelism and glibc dependent only options to reindexdb
Date
Msg-id CAOBaU_YfksDTTbvwRKoMg_r6gh7i_T+gRYgAfdNym6BJODjsSQ@mail.gmail.com
Whole thread Raw
In response to Re: Add parallelism and glibc dependent only options to reindexdb  (Michael Paquier <michael@paquier.xyz>)
Responses Re: Add parallelism and glibc dependent only options to reindexdb  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Re: Add parallelism and glibc dependent only options to reindexdb  (Michael Paquier <michael@paquier.xyz>)
List pgsql-hackers
On Mon, Jul 22, 2019 at 6:11 AM Michael Paquier <michael@paquier.xyz> wrote:
>
> On Fri, Jul 19, 2019 at 08:29:27AM +0200, Julien Rouhaud wrote:
> > On Fri, Jul 19, 2019 at 2:35 AM Michael Paquier <michael@paquier.xyz> wrote:
> >> For the second patch, could you send a rebase with a fix for the
> >> connection slot when processing the reindex commands?
> >
> > Attached, I also hopefully removed all the now unneeded progname usage.
>
> +        Note that this mode is not compatible the <option>-i / --index</option>
> +        or the <option>-s / --system</option> options.
> Nits: this is not a style consistent with the documentation.  When
> referring to both the long and short options the formulation "-i or
> --index" gets used.  Here we could just use the long option.  This
> sentence is missing a "with".

Right, so I kept the long option.  Also this comment was outdated, as
the --jobs is now just ignored with a list of indexes, so I fixed that
too.

>
>        simple_string_list_append(&tables, optarg);
> +      tbl_count++;
>        break;
> The number of items in a simple list is not counted, and vacuumdb does
> the same thing to count objects.  What do you think about extending
> simple lists to track the number of items stored?

I considered this, but it would require to adapt all code that declare
SimpleStringList stack variable (vacuumdb.c, clusterdb.c,
createuser.c, pg_dumpall.c and pg_dump.c), so it looked like too much
trouble to avoid 2 local variables here and 1 in vacuumdb.c.  I don't
have a strong opinion here, so I can go for it if you prefer.

>
> +$node->issues_sql_like([qw(reindexdb -j2)],
> +   qr/statement: REINDEX TABLE public.test1/,
> +   'Global and parallel reindex will issue per-table REINDEX');
> Would it make sense to have some tests for schemas here?
>
> One of my comments in [1] has not been answered.  What about
> the decomposition of a list of schemas into a list of tables when
> using the parallel mode?

I did that in attached v6, and added suitable regression tests.

Attachment

pgsql-hackers by date:

Previous
From: David Rowley
Date:
Subject: Re: Cleaning up and speeding up string functions
Next
From: Alexander Korotkov
Date:
Subject: Re: Psql patch to show access methods info