summaryrefslogtreecommitdiff
path: root/src/backend/optimizer/util
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2004-10-01 17:11:50 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2004-10-01 17:11:50 +0000
commitb1f8a37aa7b19f2e7a1965005503437dd15c7138 (patch)
tree8ac3d79ad122280951af658a297a801a88535d8d /src/backend/optimizer/util
parent4c5e810fcda57940d1a7178389129591eb93d68e (diff)
Fallout from changing index locking rules: we can reduce the strength
of locking used by REINDEX. REINDEX needs only ShareLock on the parent table, same as CREATE INDEX, plus an exclusive lock on the specific index being processed.
Diffstat (limited to 'src/backend/optimizer/util')
-rw-r--r--src/backend/optimizer/util/plancat.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/backend/optimizer/util/plancat.c b/src/backend/optimizer/util/plancat.c
index ba58251919b..ed76fe8fb8c 100644
--- a/src/backend/optimizer/util/plancat.c
+++ b/src/backend/optimizer/util/plancat.c
@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/optimizer/util/plancat.c,v 1.96 2004/08/29 05:06:44 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/optimizer/util/plancat.c,v 1.97 2004/10/01 17:11:50 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -90,7 +90,14 @@ get_relation_info(Oid relationObjectId, RelOptInfo *rel)
int i;
int16 amorderstrategy;
- /* Extract info from the relation descriptor for the index */
+ /*
+ * Extract info from the relation descriptor for the index.
+ *
+ * Note that we take no lock on the index; we assume our lock on
+ * the parent table will protect the index's schema information.
+ * When and if the executor actually uses the index, it will take
+ * a lock as needed to protect the access to the index contents.
+ */
indexRelation = index_open(indexoid);
index = indexRelation->rd_index;