Re: Support for REINDEX CONCURRENTLY - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Support for REINDEX CONCURRENTLY
Date
Msg-id 20121005210703.GB5769@alvh.no-ip.org
Whole thread Raw
In response to Re: Support for REINDEX CONCURRENTLY  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Support for REINDEX CONCURRENTLY  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane escribió:

> Note that allowing subsequent requests to jump the queue would not be a
> good fix for this; if you do that, it's likely the ex-lock will never be
> granted, at least not till the next system idle time.  Which if you've
> got one, you don't need a feature like this at all; you might as well
> just reindex normally during your idle time.

Not really.  The time to run a complete reindex might be several hours.
If the idle time is just a few minutes or seconds long, it may be more
than enough to complete the switch operation, but not to run the
complete reindex.

Maybe another idea is that the reindexing is staged: the user would
first run a command to create the replacement index, and leave both
present until the user runs a second command (which acquires a strong
lock) that executes the switch.  Somehow similar to a constraint created
as NOT VALID (which runs without a strong lock) which can be later
validated separately.

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



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Support for REINDEX CONCURRENTLY
Next
From: Tom Lane
Date:
Subject: Re: Support for REINDEX CONCURRENTLY