summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2011-04-19 18:50:56 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2011-04-19 18:50:56 -0400
commit8c19977e9c515cc29af449a7ab6c25e496f539f3 (patch)
tree847ff5b4afc0cf472bcae0faa96abd2021090f4e /src/include
parentc096d19b74a637443109e528000342e896b150f3 (diff)
Avoid changing an index's indcheckxmin horizon during REINDEX.
There can never be a need to push the indcheckxmin horizon forward, since any HOT chains that are actually broken with respect to the index must pre-date its original creation. So we can just avoid changing pg_index altogether during a REINDEX operation. This offers a cleaner solution than my previous patch for the problem found a few days ago that we mustn't try to update pg_index while we are reindexing it. System catalog indexes will always be created with indcheckxmin = false during initdb, and with this modified code we should never try to change their pg_index entries. This avoids special-casing system catalogs as the former patch did, and should provide a performance benefit for many cases where REINDEX formerly caused an index to be considered unusable for a short time. Back-patch to 8.3 to cover all versions containing HOT. Note that this patch changes the API for index_build(), but I believe it is unlikely that any add-on code is calling that directly.
Diffstat (limited to 'src/include')
-rw-r--r--src/include/catalog/index.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index cc7e785cc0a..071db7f4012 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -75,7 +75,8 @@ extern void FormIndexDatum(IndexInfo *indexInfo,
extern void index_build(Relation heapRelation,
Relation indexRelation,
IndexInfo *indexInfo,
- bool isprimary);
+ bool isprimary,
+ bool isreindex);
extern double IndexBuildHeapScan(Relation heapRelation,
Relation indexRelation,