gooderp18绿色标准版
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

332 satır
11KB

  1. /*------------------------------------------------------------------------
  2. * PostgreSQL manual configuration settings
  3. *
  4. * This file contains various configuration symbols and limits. In
  5. * all cases, changing them is only useful in very rare situations or
  6. * for developers. If you edit any of these, be sure to do a *full*
  7. * rebuild (and an initdb if noted).
  8. *
  9. * Portions Copyright (c) 1996-2019, PostgreSQL Global Development Group
  10. * Portions Copyright (c) 1994, Regents of the University of California
  11. *
  12. * src/include/pg_config_manual.h
  13. *------------------------------------------------------------------------
  14. */
  15. /*
  16. * This is the default value for wal_segment_size to be used when initdb is run
  17. * without the --wal-segsize option. It must be a valid segment size.
  18. */
  19. #define DEFAULT_XLOG_SEG_SIZE (16*1024*1024)
  20. /*
  21. * Maximum length for identifiers (e.g. table names, column names,
  22. * function names). Names actually are limited to one less byte than this,
  23. * because the length must include a trailing zero byte.
  24. *
  25. * Changing this requires an initdb.
  26. */
  27. #define NAMEDATALEN 64
  28. /*
  29. * Maximum number of arguments to a function.
  30. *
  31. * The minimum value is 8 (GIN indexes use 8-argument support functions).
  32. * The maximum possible value is around 600 (limited by index tuple size in
  33. * pg_proc's index; BLCKSZ larger than 8K would allow more). Values larger
  34. * than needed will waste memory and processing time, but do not directly
  35. * cost disk space.
  36. *
  37. * Changing this does not require an initdb, but it does require a full
  38. * backend recompile (including any user-defined C functions).
  39. */
  40. #define FUNC_MAX_ARGS 100
  41. /*
  42. * Maximum number of columns in an index. There is little point in making
  43. * this anything but a multiple of 32, because the main cost is associated
  44. * with index tuple header size (see access/itup.h).
  45. *
  46. * Changing this requires an initdb.
  47. */
  48. #define INDEX_MAX_KEYS 32
  49. /*
  50. * Maximum number of columns in a partition key
  51. */
  52. #define PARTITION_MAX_KEYS 32
  53. /*
  54. * When we don't have native spinlocks, we use semaphores to simulate them.
  55. * Decreasing this value reduces consumption of OS resources; increasing it
  56. * may improve performance, but supplying a real spinlock implementation is
  57. * probably far better.
  58. */
  59. #define NUM_SPINLOCK_SEMAPHORES 128
  60. /*
  61. * When we have neither spinlocks nor atomic operations support we're
  62. * implementing atomic operations on top of spinlock on top of semaphores. To
  63. * be safe against atomic operations while holding a spinlock separate
  64. * semaphores have to be used.
  65. */
  66. #define NUM_ATOMICS_SEMAPHORES 64
  67. /*
  68. * MAXPGPATH: standard size of a pathname buffer in PostgreSQL (hence,
  69. * maximum usable pathname length is one less).
  70. *
  71. * We'd use a standard system header symbol for this, if there weren't
  72. * so many to choose from: MAXPATHLEN, MAX_PATH, PATH_MAX are all
  73. * defined by different "standards", and often have different values
  74. * on the same platform! So we just punt and use a reasonably
  75. * generous setting here.
  76. */
  77. #define MAXPGPATH 1024
  78. /*
  79. * PG_SOMAXCONN: maximum accept-queue length limit passed to
  80. * listen(2). You'd think we should use SOMAXCONN from
  81. * <sys/socket.h>, but on many systems that symbol is much smaller
  82. * than the kernel's actual limit. In any case, this symbol need be
  83. * twiddled only if you have a kernel that refuses large limit values,
  84. * rather than silently reducing the value to what it can handle
  85. * (which is what most if not all Unixen do).
  86. */
  87. #define PG_SOMAXCONN 10000
  88. /*
  89. * You can try changing this if you have a machine with bytes of
  90. * another size, but no guarantee...
  91. */
  92. #define BITS_PER_BYTE 8
  93. /*
  94. * Preferred alignment for disk I/O buffers. On some CPUs, copies between
  95. * user space and kernel space are significantly faster if the user buffer
  96. * is aligned on a larger-than-MAXALIGN boundary. Ideally this should be
  97. * a platform-dependent value, but for now we just hard-wire it.
  98. */
  99. #define ALIGNOF_BUFFER 32
  100. /*
  101. * Disable UNIX sockets for certain operating systems.
  102. */
  103. #if defined(WIN32)
  104. #undef HAVE_UNIX_SOCKETS
  105. #endif
  106. /*
  107. * Define this if your operating system supports link()
  108. */
  109. #if !defined(WIN32) && !defined(__CYGWIN__)
  110. #define HAVE_WORKING_LINK 1
  111. #endif
  112. /*
  113. * USE_POSIX_FADVISE controls whether Postgres will attempt to use the
  114. * posix_fadvise() kernel call. Usually the automatic configure tests are
  115. * sufficient, but some older Linux distributions had broken versions of
  116. * posix_fadvise(). If necessary you can remove the #define here.
  117. */
  118. #if HAVE_DECL_POSIX_FADVISE && defined(HAVE_POSIX_FADVISE)
  119. #define USE_POSIX_FADVISE
  120. #endif
  121. /*
  122. * USE_PREFETCH code should be compiled only if we have a way to implement
  123. * prefetching. (This is decoupled from USE_POSIX_FADVISE because there
  124. * might in future be support for alternative low-level prefetch APIs.
  125. * If you change this, you probably need to adjust the error message in
  126. * check_effective_io_concurrency.)
  127. */
  128. #ifdef USE_POSIX_FADVISE
  129. #define USE_PREFETCH
  130. #endif
  131. /*
  132. * Default and maximum values for backend_flush_after, bgwriter_flush_after
  133. * and checkpoint_flush_after; measured in blocks. Currently, these are
  134. * enabled by default if sync_file_range() exists, ie, only on Linux. Perhaps
  135. * we could also enable by default if we have mmap and msync(MS_ASYNC)?
  136. */
  137. #ifdef HAVE_SYNC_FILE_RANGE
  138. #define DEFAULT_BACKEND_FLUSH_AFTER 0 /* never enabled by default */
  139. #define DEFAULT_BGWRITER_FLUSH_AFTER 64
  140. #define DEFAULT_CHECKPOINT_FLUSH_AFTER 32
  141. #else
  142. #define DEFAULT_BACKEND_FLUSH_AFTER 0
  143. #define DEFAULT_BGWRITER_FLUSH_AFTER 0
  144. #define DEFAULT_CHECKPOINT_FLUSH_AFTER 0
  145. #endif
  146. /* upper limit for all three variables */
  147. #define WRITEBACK_MAX_PENDING_FLUSHES 256
  148. /*
  149. * USE_SSL code should be compiled only when compiling with an SSL
  150. * implementation. (Currently, only OpenSSL is supported, but we might add
  151. * more implementations in the future.)
  152. */
  153. #ifdef USE_OPENSSL
  154. #define USE_SSL
  155. #endif
  156. /*
  157. * This is the default directory in which AF_UNIX socket files are
  158. * placed. Caution: changing this risks breaking your existing client
  159. * applications, which are likely to continue to look in the old
  160. * directory. But if you just hate the idea of sockets in /tmp,
  161. * here's where to twiddle it. You can also override this at runtime
  162. * with the postmaster's -k switch.
  163. */
  164. #define DEFAULT_PGSOCKET_DIR "/tmp"
  165. /*
  166. * This is the default event source for Windows event log.
  167. */
  168. #define DEFAULT_EVENT_SOURCE "PostgreSQL"
  169. /*
  170. * The random() function is expected to yield values between 0 and
  171. * MAX_RANDOM_VALUE. Currently, all known implementations yield
  172. * 0..2^31-1, so we just hardwire this constant. We could do a
  173. * configure test if it proves to be necessary. CAUTION: Think not to
  174. * replace this with RAND_MAX. RAND_MAX defines the maximum value of
  175. * the older rand() function, which is often different from --- and
  176. * considerably inferior to --- random().
  177. */
  178. #define MAX_RANDOM_VALUE PG_INT32_MAX
  179. /*
  180. * On PPC machines, decide whether to use the mutex hint bit in LWARX
  181. * instructions. Setting the hint bit will slightly improve spinlock
  182. * performance on POWER6 and later machines, but does nothing before that,
  183. * and will result in illegal-instruction failures on some pre-POWER4
  184. * machines. By default we use the hint bit when building for 64-bit PPC,
  185. * which should be safe in nearly all cases. You might want to override
  186. * this if you are building 32-bit code for a known-recent PPC machine.
  187. */
  188. #ifdef HAVE_PPC_LWARX_MUTEX_HINT /* must have assembler support in any case */
  189. #if defined(__ppc64__) || defined(__powerpc64__)
  190. #define USE_PPC_LWARX_MUTEX_HINT
  191. #endif
  192. #endif
  193. /*
  194. * On PPC machines, decide whether to use LWSYNC instructions in place of
  195. * ISYNC and SYNC. This provides slightly better performance, but will
  196. * result in illegal-instruction failures on some pre-POWER4 machines.
  197. * By default we use LWSYNC when building for 64-bit PPC, which should be
  198. * safe in nearly all cases.
  199. */
  200. #if defined(__ppc64__) || defined(__powerpc64__)
  201. #define USE_PPC_LWSYNC
  202. #endif
  203. /*
  204. * Assumed cache line size. This doesn't affect correctness, but can be used
  205. * for low-level optimizations. Currently, this is used to pad some data
  206. * structures in xlog.c, to ensure that highly-contended fields are on
  207. * different cache lines. Too small a value can hurt performance due to false
  208. * sharing, while the only downside of too large a value is a few bytes of
  209. * wasted memory. The default is 128, which should be large enough for all
  210. * supported platforms.
  211. */
  212. #define PG_CACHE_LINE_SIZE 128
  213. /*
  214. *------------------------------------------------------------------------
  215. * The following symbols are for enabling debugging code, not for
  216. * controlling user-visible features or resource limits.
  217. *------------------------------------------------------------------------
  218. */
  219. /*
  220. * Include Valgrind "client requests", mostly in the memory allocator, so
  221. * Valgrind understands PostgreSQL memory contexts. This permits detecting
  222. * memory errors that Valgrind would not detect on a vanilla build. See also
  223. * src/tools/valgrind.supp. "make installcheck" runs 20-30x longer under
  224. * Valgrind. Note that USE_VALGRIND slowed older versions of Valgrind by an
  225. * additional order of magnitude; Valgrind 3.8.1 does not have this problem.
  226. * The client requests fall in hot code paths, so USE_VALGRIND also slows
  227. * native execution by a few percentage points.
  228. *
  229. * You should normally use MEMORY_CONTEXT_CHECKING with USE_VALGRIND;
  230. * instrumentation of repalloc() is inferior without it.
  231. */
  232. /* #define USE_VALGRIND */
  233. /*
  234. * Define this to cause pfree()'d memory to be cleared immediately, to
  235. * facilitate catching bugs that refer to already-freed values.
  236. * Right now, this gets defined automatically if --enable-cassert.
  237. */
  238. #ifdef USE_ASSERT_CHECKING
  239. #define CLOBBER_FREED_MEMORY
  240. #endif
  241. /*
  242. * Define this to check memory allocation errors (scribbling on more
  243. * bytes than were allocated). Right now, this gets defined
  244. * automatically if --enable-cassert or USE_VALGRIND.
  245. */
  246. #if defined(USE_ASSERT_CHECKING) || defined(USE_VALGRIND)
  247. #define MEMORY_CONTEXT_CHECKING
  248. #endif
  249. /*
  250. * Define this to cause palloc()'d memory to be filled with random data, to
  251. * facilitate catching code that depends on the contents of uninitialized
  252. * memory. Caution: this is horrendously expensive.
  253. */
  254. /* #define RANDOMIZE_ALLOCATED_MEMORY */
  255. /*
  256. * Define this to force all parse and plan trees to be passed through
  257. * copyObject(), to facilitate catching errors and omissions in
  258. * copyObject().
  259. */
  260. /* #define COPY_PARSE_PLAN_TREES */
  261. /*
  262. * Define this to force all parse and plan trees to be passed through
  263. * outfuncs.c/readfuncs.c, to facilitate catching errors and omissions in
  264. * those modules.
  265. */
  266. /* #define WRITE_READ_PARSE_PLAN_TREES */
  267. /*
  268. * Define this to force all raw parse trees for DML statements to be scanned
  269. * by raw_expression_tree_walker(), to facilitate catching errors and
  270. * omissions in that function.
  271. */
  272. /* #define RAW_EXPRESSION_COVERAGE_TEST */
  273. /*
  274. * Enable debugging print statements for lock-related operations.
  275. */
  276. /* #define LOCK_DEBUG */
  277. /*
  278. * Enable debugging print statements for WAL-related operations; see
  279. * also the wal_debug GUC var.
  280. */
  281. /* #define WAL_DEBUG */
  282. /*
  283. * Enable tracing of resource consumption during sort operations;
  284. * see also the trace_sort GUC var. For 8.1 this is enabled by default.
  285. */
  286. #define TRACE_SORT 1
  287. /*
  288. * Enable tracing of syncscan operations (see also the trace_syncscan GUC var).
  289. */
  290. /* #define TRACE_SYNCSCAN */
  291. /*
  292. * Other debug #defines (documentation, anyone?)
  293. */
  294. /* #define HEAPDEBUGALL */
  295. /* #define ACLDEBUG */
上海开阖软件有限公司 沪ICP备12045867号-1