Re: [BUGS] BUG #10823: Better REINDEX syntax. - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: [BUGS] BUG #10823: Better REINDEX syntax.
Date
Msg-id 20140828230056.GD7705@eldon.alvh.no-ip.org
Whole thread Raw
In response to Re: [BUGS] BUG #10823: Better REINDEX syntax.  (Vik Fearing <vik.fearing@dalibo.com>)
Responses Re: [BUGS] BUG #10823: Better REINDEX syntax.
List pgsql-hackers
Vik Fearing wrote:

> Here are two patches for this.
>
> The first one, reindex_user_tables.v1.patch, implements the variant that
> only hits user tables, as suggested by you.
>
> The second one, reindex_no_dbname.v1.patch, allows the three
> database-wide variants to omit the database name (voted for by Daniel
> Migowski, Bruce, and myself; voted against by you).  This patch is to be
> applied on top of the first one.

Not a fan.  Here's a revised version that provides REINDEX USER TABLES,
which can only be used without a database name; other modes are not
affected i.e. they continue to require a database name.  I also renamed
your proposed reindexdb's --usertables to --user-tables.

Oh, I just noticed that if you say reindexdb --all --user-tables, the
latter is not honored.  Must fix before commit.

Makes sense?

Note: I don't like the reindexdb UI; if you just run "reindexdb -d
foobar" it will reindex everything, including system catalogs.  I think
USER TABLES should be the default operation mode for reindex.   If you
want plain old "REINDEX DATABASE foobar" which also hits the catalogs,
you should request that separately (how?).  This patch doesn't change
this.

Also note: if you say "user tables", information_schema is reindexed too,
which kinda sucks.

Further note: this command is probably pointless in the majority of
cases.  Somebody should spend some serious time with REINDEX
CONCURRENTLY ..

--
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

Attachment

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Multithreaded SIGPIPE race in libpq on Solaris
Next
From: Thomas Munro
Date:
Subject: Re: Multithreaded SIGPIPE race in libpq on Solaris