Re: [BUGS] BUG #10823: Better REINDEX syntax.

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Vik Fearing <vik(dot)fearing(at)dalibo(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Bruce Momjian <bruce(at)momjian(dot)us>, dmigowski(at)ikoffice(dot)de, PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [BUGS] BUG #10823: Better REINDEX syntax.
Date: 2014-08-28 23:00:57
Message-ID: 20140828230056.GD7705@eldon.alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs 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 Content-Type Size
reindex_user_tables.v2.patch text/x-diff 10.4 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2014-08-29 02:39:22 Re: [BUGS] BUG #9652: inet types don't support min/max
Previous Message Tom Lane 2014-08-28 22:24:30 Re: Error with citext extension when upgrading from 9.0.3 to 9.3.5: 'cannot cast type oid[] to oidvector'

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2014-08-29 00:04:21 Re: Multithreaded SIGPIPE race in libpq on Solaris
Previous Message Tom Lane 2014-08-28 22:45:31 Re: Multithreaded SIGPIPE race in libpq on Solaris