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

From: Vik Fearing <vik(dot)fearing(at)dalibo(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Bruce Momjian <bruce(at)momjian(dot)us>
Cc: dmigowski(at)ikoffice(dot)de, PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [BUGS] BUG #10823: Better REINDEX syntax.
Date: 2014-08-01 10:20:14
Message-ID: 53DB69DE.8040009@dalibo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

On 07/30/2014 07:46 PM, Tom Lane wrote:
> Bruce Momjian <bruce(at)momjian(dot)us> writes:
>> On Wed, Jul 30, 2014 at 01:29:31PM -0400, Tom Lane wrote:
>>> I don't find it all that odd. We should not be encouraging routine
>>> database-wide reindexes.
>
>> Uh, do we encourage database-wide VACUUM FULL or CLUSTER, as we use them
>> there with no parameter. Is there a reason REINDEX should be harder,
>> and require a dummy argument to run?
>
> I believe that REINDEX on system catalogs carries a risk of deadlock
> failures against other processes --- there was a recent example of that
> in the mailing lists. VACUUM FULL has such risks too, but that's been
> pretty well deprecated for many years. (I think CLUSTER is probably
> relatively safe on this score because it's not going to think any system
> catalogs are clustered.)
>
> If there were a variant of REINDEX that only hit user tables, I'd be fine
> with making that easy to invoke.

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.
--
Vik

Attachment Content-Type Size
reindex_user_tables.v1.patch text/x-diff 9.5 KB
reindex_no_dbname.v1.patch text/x-diff 3.8 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message jesse.denardo 2014-08-01 13:30:13 BUG #11107: UPDATE violates table check constraint
Previous Message David G Johnston 2014-08-01 08:27:12 Re: BUG #11103: to_json() does not convert correctly DOMAINs type since 9.3.5 (int expected instead of string) ?

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2014-08-01 11:35:28 Bug of pg_receivexlog -v
Previous Message David Rowley 2014-08-01 09:37:24 Re: SKIP LOCKED DATA (work in progress)