diff options
Diffstat (limited to 'src/backend/access/hash/hash.c')
-rw-r--r-- | src/backend/access/hash/hash.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/backend/access/hash/hash.c b/src/backend/access/hash/hash.c index 1130367b65d..6e729008e85 100644 --- a/src/backend/access/hash/hash.c +++ b/src/backend/access/hash/hash.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/access/hash/hash.c,v 1.30 1999/07/17 20:16:38 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/hash/hash.c,v 1.31 1999/09/18 19:05:52 tgl Exp $ * * NOTES * This file contains only the public interface routines. @@ -66,8 +66,6 @@ hashbuild(Relation heap, TupleTableSlot *slot; #endif - Oid hrelid, - irelid; Node *pred, *oldPred; @@ -232,17 +230,20 @@ hashbuild(Relation heap, /* * Since we just counted the tuples in the heap, we update its stats * in pg_class to guarantee that the planner takes advantage of the - * index we just created. Finally, only update statistics during + * index we just created. But, only update statistics during * normal index definitions, not for indices on system catalogs * created during bootstrap processing. We must close the relations - * before updatings statistics to guarantee that the relcache entries + * before updating statistics to guarantee that the relcache entries * are flushed when we increment the command counter in UpdateStats(). + * But we do not release any locks on the relations; those will be + * held until end of transaction. */ if (IsNormalProcessingMode()) { - hrelid = RelationGetRelid(heap); - irelid = RelationGetRelid(index); - heap_close(heap); + Oid hrelid = RelationGetRelid(heap); + Oid irelid = RelationGetRelid(index); + + heap_close(heap, NoLock); index_close(index); UpdateStats(hrelid, nhtups, true); UpdateStats(irelid, nitups, false); |