Re: Support for REINDEX CONCURRENTLY

Michael Paquier <michael.paquier@gmail.com>

From: Michael Paquier <michael.paquier@gmail.com>
To: Fujii Masao <masao.fujii@gmail.com>
Cc: Andres Freund <andres@2ndquadrant.com>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>, Peter Eisentraut <peter_e@gmx.net>, Tom Lane <tgl@sss.pgh.pa.us>, Simon Riggs <simon@2ndquadrant.com>
Date: 2013-03-13T12:04:48Z
Lists: pgsql-hackers

Attachments

I have been working on improving the code of the 2 patches:
1) reltoastidxid removal:
- Improvement of mechanism in tuptoaster.c to fetch the first valid index
for toast value deletion and fetch
- Added a macro called RelationGetIndexListIfValid that avoids recompiling
the index list with list_copy as RelationGetIndexList does. Not using a
macro resulted in increased shared memory usage when multiple toast values
were added inside the same query (stuff like "insert into tab values
(generate_series(1,1000), '2k_long_text')")
- Fix a bug with pg_dump and binary upgrade. One valid index is necessary
for a given toast relation.
2) reindex concurrently:
- correction of some comments
- fix for index_concurrent_set_dead where process did not wait that other
backends released lock on parent relation
- addition of a error message in index_concurrent_drop if it is tried to
drop a live index. Dropping a live index with only ShareUpdate lock is
dangerous

I am also planning to test the potential performance impact of the patch
removing reltoastidxid with scripts of the type attached. I don't really
know if it can be quantified but I'll give a try with some methods (not yet
completely defined).
-- 
Michael

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Background worker processes

  2. Fix assorted bugs in CREATE/DROP INDEX CONCURRENTLY.

  3. Work around unportable behavior of malloc(0) and realloc(NULL, 0).

  4. Properly set relpersistence for fake relcache entries.