@@ -970,17 +970,15 @@ InitPredicateLocks(void)
970970{
971971HASHCTL info ;
972972int hash_flags ;
973- long init_table_size ,
974- max_table_size ;
973+ long max_table_size ;
975974Size requestSize ;
976975bool found ;
977976
978977/*
979- * Computeinit/max sizeto request for predicate lock target hashtable.
978+ * Compute sizeof predicate lock target hashtable.
980979 * Note these calculations must agree with PredicateLockShmemSize!
981980 */
982981max_table_size = NPREDICATELOCKTARGETENTS ();
983- init_table_size = max_table_size /2 ;
984982
985983/*
986984 * Allocate hash table for PREDICATELOCKTARGET structs. This stores
@@ -991,17 +989,16 @@ InitPredicateLocks(void)
991989info .entrysize = sizeof (PREDICATELOCKTARGET );
992990info .hash = tag_hash ;
993991info .num_partitions = NUM_PREDICATELOCK_PARTITIONS ;
994- hash_flags = (HASH_ELEM |HASH_FUNCTION |HASH_PARTITION );
992+ hash_flags = (HASH_ELEM |HASH_FUNCTION |HASH_PARTITION | HASH_FIXED_SIZE );
995993
996994PredicateLockTargetHash = ShmemInitHash ("PREDICATELOCKTARGET hash" ,
997- init_table_size ,
995+ max_table_size ,
998996max_table_size ,
999997& info ,
1000998hash_flags );
1001999
10021000/* Assume an average of 2 xacts per target */
10031001max_table_size *=2 ;
1004- init_table_size *=2 ;
10051002
10061003/*
10071004 * Reserve an entry in the hash table; we use it to make sure there's
@@ -1022,18 +1019,17 @@ InitPredicateLocks(void)
10221019info .entrysize = sizeof (PREDICATELOCK );
10231020info .hash = predicatelock_hash ;
10241021info .num_partitions = NUM_PREDICATELOCK_PARTITIONS ;
1025- hash_flags = (HASH_ELEM |HASH_FUNCTION |HASH_PARTITION );
1022+ hash_flags = (HASH_ELEM |HASH_FUNCTION |HASH_PARTITION | HASH_FIXED_SIZE );
10261023
10271024PredicateLockHash = ShmemInitHash ("PREDICATELOCK hash" ,
1028- init_table_size ,
1025+ max_table_size ,
10291026max_table_size ,
10301027& info ,
10311028hash_flags );
10321029
10331030/*
1034- * Compute init/max size to request for serializable transaction
1035- * hashtable. Note these calculations must agree with
1036- * PredicateLockShmemSize!
1031+ * Compute size for serializable transaction hashtable.
1032+ * Note these calculations must agree with PredicateLockShmemSize!
10371033 */
10381034max_table_size = (MaxBackends + max_prepared_xacts );
10391035
@@ -1104,7 +1100,7 @@ InitPredicateLocks(void)
11041100info .keysize = sizeof (SERIALIZABLEXIDTAG );
11051101info .entrysize = sizeof (SERIALIZABLEXID );
11061102info .hash = tag_hash ;
1107- hash_flags = (HASH_ELEM |HASH_FUNCTION );
1103+ hash_flags = (HASH_ELEM |HASH_FUNCTION | HASH_FIXED_SIZE );
11081104
11091105SerializableXidHash = ShmemInitHash ("SERIALIZABLEXID hash" ,
11101106max_table_size ,