Reduce the default size of the PortalHashTable in order to save a
authorTom Lane <[email protected]>
Sun, 21 Nov 2004 22:48:01 +0000 (22:48 +0000)
committerTom Lane <[email protected]>
Sun, 21 Nov 2004 22:48:01 +0000 (22:48 +0000)
few cycles during transaction exit.  A typical session probably
wouldn't have as many as half a dozen portals open at once, so the
original value of 64 seems far larger than needed.

src/backend/utils/mmgr/portalmem.c

index 440967c8a21e6b160d92b13042c2a9e73b3700fe..3be1bfb5432bf04781048aaf8d00d410c5e9c793 100644 (file)
 #include "utils/portal.h"
 
 /*
- * estimate of the maximum number of open portals a user would have,
- * used in initially sizing the PortalHashTable in EnablePortalManager()
+ * Estimate of the maximum number of open portals a user would have,
+ * used in initially sizing the PortalHashTable in EnablePortalManager().
+ * Since the hash table can expand, there's no need to make this overly
+ * generous, and keeping it small avoids unnecessary overhead in the
+ * hash_seq_search() calls executed during transaction end.
  */
-#define PORTALS_PER_USER          64
+#define PORTALS_PER_USER          16
 
 
 /* ----------------