Move default NBuffers setting into config.h, and rename it
authorTom Lane <tgl@sss.pgh.pa.us>
Sat, 12 Jun 1999 22:17:24 +0000 (22:17 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sat, 12 Jun 1999 22:17:24 +0000 (22:17 +0000)
to DEF_NBUFFERS for readability.  Make sure the default value is OK
according to postmaster.c's new sanity check for -B values.

src/backend/storage/buffer/buf_init.c
src/include/config.h.in
src/include/miscadmin.h

index b8dddcf8e8c4167aaea1b5dce7c8bbd28119fa23..50f01635dfc2c96495966505ba2231266c5f56eb 100644 (file)
@@ -50,7 +50,7 @@ long     *CurTraceBuf;
 #endif  /* BMTRACE */
 int                    ShowPinTrace = 0;
 
-int                    NBuffers = NDBUFS;      /* NDBUFS defined in miscadmin.h */
+int                    NBuffers = DEF_NBUFFERS;        /* default is set in config.h */
 int                    Data_Descriptors;
 int                    Free_List_Descriptor;
 int                    Lookup_List_Descriptor;
index 9afb5e251f0c99013ef41dcd332c1f38df2b8426..20e5e5c37774b7285fd2a126271602277a103e0e 100644 (file)
  */
 #define MAXBACKENDS    (DEF_MAXBACKENDS > 1024 ? DEF_MAXBACKENDS : 1024)
 
+/*
+ * Default number of buffers in shared buffer pool (each of size BLCKSZ).
+ * This is just the default setting for the postmaster's -B switch.
+ * Perhaps it ought to be configurable from a configure switch.
+ * NOTE: default setting corresponds to the minimum number of buffers
+ * that postmaster.c will allow for the default MaxBackends value.
+ */
+#define DEF_NBUFFERS (DEF_MAXBACKENDS > 8 ? DEF_MAXBACKENDS * 2 : 16)
+
 /*
  * Size of a disk block --- currently, this limits the size of a tuple.
  * You can set it bigger if you need bigger tuples.
index 60ce631d151dce61292fd667554823c7babd7287..26b261ce6e5186ee355a4f7b81bcc10b34d16800 100644 (file)
@@ -102,12 +102,6 @@ extern Oid LastOidProcessed;       /* for query rewrite */
 /* #define MAX_QUERY_SIZE       (BLCKSZ*2) */
 #define MAX_PARSE_BUFFER MAX_QUERY_SIZE
 
-/*
- *             default number of buffers in buffer pool
- *
- */
-#define NDBUFS 64
-
 /*****************************************************************************
  *       pdir.h --                                                                                                                              *
  *                     POSTGRES directory path definitions.                                                     *