]> granicus.if.org Git - postgresql/blob - src/include/pg_config_manual.h
Add a trace_sort option to help with measuring resource usage of external
[postgresql] / src / include / pg_config_manual.h
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  * $PostgreSQL: pgsql/src/include/pg_config_manual.h,v 1.17 2005/10/03 22:55:56 tgl Exp $
10  *------------------------------------------------------------------------
11  */
12
13 /*
14  * Size of a disk block --- this also limits the size of a tuple.  You
15  * can set it bigger if you need bigger tuples (although TOAST should
16  * reduce the need to have large tuples, since fields can be spread
17  * across multiple tuples).
18  *
19  * BLCKSZ must be a power of 2.  The maximum possible value of BLCKSZ
20  * is currently 2^15 (32768).  This is determined by the 15-bit widths
21  * of the lp_off and lp_len fields in ItemIdData (see
22  * include/storage/itemid.h).
23  *
24  * Changing BLCKSZ requires an initdb.
25  */
26 #define BLCKSZ  8192
27
28 /*
29  * RELSEG_SIZE is the maximum number of blocks allowed in one disk
30  * file.  Thus, the maximum size of a single file is RELSEG_SIZE *
31  * BLCKSZ; relations bigger than that are divided into multiple files.
32  *
33  * RELSEG_SIZE * BLCKSZ must be less than your OS' limit on file size.
34  * This is often 2 GB or 4GB in a 32-bit operating system, unless you
35  * have large file support enabled.  By default, we make the limit 1
36  * GB to avoid any possible integer-overflow problems within the OS.
37  * A limit smaller than necessary only means we divide a large
38  * relation into more chunks than necessary, so it seems best to err
39  * in the direction of a small limit.  (Besides, a power-of-2 value
40  * saves a few cycles in md.c.)
41  *
42  * Changing RELSEG_SIZE requires an initdb.
43  */
44 #define RELSEG_SIZE (0x40000000 / BLCKSZ)
45
46 /*
47  * XLOG_SEG_SIZE is the size of a single WAL file.      This must be a power of 2
48  * and larger than BLCKSZ (preferably, a great deal larger than BLCKSZ).
49  *
50  * Changing XLOG_SEG_SIZE requires an initdb.
51  */
52 #define XLOG_SEG_SIZE   (16*1024*1024)
53
54 /*
55  * Maximum number of arguments to a function.
56  *
57  * The minimum value is 8 (index creation uses 8-argument functions).
58  * The maximum possible value is around 600 (limited by index tuple size in
59  * pg_proc's index; BLCKSZ larger than 8K would allow more).  Values larger
60  * than needed will waste memory and processing time, but do not directly
61  * cost disk space.
62  *
63  * Changing this does not require an initdb, but it does require a full
64  * backend recompile (including any user-defined C functions).
65  */
66 #define FUNC_MAX_ARGS           100
67
68 /*
69  * Maximum number of columns in an index.  There is little point in making
70  * this anything but a multiple of 32, because the main cost is associated
71  * with index tuple header size (see access/itup.h).
72  *
73  * Changing this requires an initdb.
74  */
75 #define INDEX_MAX_KEYS          32
76
77 /*
78  * Define this to make libpgtcl's "pg_result -assign" command process
79  * C-style backslash sequences in returned tuple data and convert
80  * PostgreSQL array values into Tcl lists.      CAUTION: This conversion
81  * is *wrong* unless you install the routines in
82  * contrib/string/string_io to make the server produce C-style
83  * backslash sequences in the first place.
84  */
85 /* #define TCL_ARRAYS */
86
87 /*
88  * User locks are handled totally on the application side as long term
89  * cooperative locks which extend beyond the normal transaction
90  * boundaries.  Their purpose is to indicate to an application that
91  * someone is `working' on an item.  Define this flag to enable user
92  * locks.  You will need the loadable module user-locks.c to use this
93  * feature.
94  */
95 #define USER_LOCKS
96
97 /*
98  * Define this if you want psql to _always_ ask for a username and a
99  * password for password authentication.
100  */
101 /* #define PSQL_ALWAYS_GET_PASSWORDS */
102
103 /*
104  * Define this if you want to allow the lo_import and lo_export SQL
105  * functions to be executed by ordinary users.  By default these
106  * functions are only available to the Postgres superuser.      CAUTION:
107  * These functions are SECURITY HOLES since they can read and write
108  * any file that the PostgreSQL server has permission to access.  If
109  * you turn this on, don't say we didn't warn you.
110  */
111 /* #define ALLOW_DANGEROUS_LO_FUNCTIONS */
112
113 /*
114  * MAXPGPATH: standard size of a pathname buffer in PostgreSQL (hence,
115  * maximum usable pathname length is one less).
116  *
117  * We'd use a standard system header symbol for this, if there weren't
118  * so many to choose from: MAXPATHLEN, MAX_PATH, PATH_MAX are all
119  * defined by different "standards", and often have different values
120  * on the same platform!  So we just punt and use a reasonably
121  * generous setting here.
122  */
123 #define MAXPGPATH               1024
124
125 /*
126  * PG_SOMAXCONN: maximum accept-queue length limit passed to
127  * listen(2).  You'd think we should use SOMAXCONN from
128  * <sys/socket.h>, but on many systems that symbol is much smaller
129  * than the kernel's actual limit.  In any case, this symbol need be
130  * twiddled only if you have a kernel that refuses large limit values,
131  * rather than silently reducing the value to what it can handle
132  * (which is what most if not all Unixen do).
133  */
134 #define PG_SOMAXCONN    10000
135
136 /*
137  * You can try changing this if you have a machine with bytes of
138  * another size, but no guarantee...
139  */
140 #define BITS_PER_BYTE           8
141
142 /*
143  * Preferred alignment for disk I/O buffers.  On some CPUs, copies between
144  * user space and kernel space are significantly faster if the user buffer
145  * is aligned on a larger-than-MAXALIGN boundary.  Ideally this should be
146  * a platform-dependent value, but for now we just hard-wire it.
147  */
148 #define ALIGNOF_BUFFER  32
149
150 /*
151  * Disable UNIX sockets for those operating system.
152  */
153 #if defined(__QNX__) || defined(__BEOS__) || defined(WIN32)
154 #undef HAVE_UNIX_SOCKETS
155 #endif
156
157 /*
158  * Define this if your operating system supports link()
159  */
160 #if !defined(__QNX__) && !defined(__BEOS__) && \
161         !defined(WIN32) && !defined(__CYGWIN__)
162 #define HAVE_WORKING_LINK 1
163 #endif
164
165 /*
166  * This is the default directory in which AF_UNIX socket files are
167  * placed.      Caution: changing this risks breaking your existing client
168  * applications, which are likely to continue to look in the old
169  * directory.  But if you just hate the idea of sockets in /tmp,
170  * here's where to twiddle it.  You can also override this at runtime
171  * with the postmaster's -k switch.
172  */
173 #define DEFAULT_PGSOCKET_DIR  "/tmp"
174
175 /*
176  * The random() function is expected to yield values between 0 and
177  * MAX_RANDOM_VALUE.  Currently, all known implementations yield
178  * 0..2^31-1, so we just hardwire this constant.  We could do a
179  * configure test if it proves to be necessary.  CAUTION: Think not to
180  * replace this with RAND_MAX.  RAND_MAX defines the maximum value of
181  * the older rand() function, which is often different from --- and
182  * considerably inferior to --- random().
183  */
184 #define MAX_RANDOM_VALUE  (0x7FFFFFFF)
185
186
187 /*
188  *------------------------------------------------------------------------
189  * The following symbols are for enabling debugging code, not for
190  * controlling user-visible features or resource limits.
191  *------------------------------------------------------------------------
192  */
193
194 /*
195  * Define this to cause pfree()'d memory to be cleared immediately, to
196  * facilitate catching bugs that refer to already-freed values.  XXX
197  * Right now, this gets defined automatically if --enable-cassert.      In
198  * the long term it probably doesn't need to be on by default.
199  */
200 #ifdef USE_ASSERT_CHECKING
201 #define CLOBBER_FREED_MEMORY
202 #endif
203
204 /*
205  * Define this to check memory allocation errors (scribbling on more
206  * bytes than were allocated).  Right now, this gets defined
207  * automatically if --enable-cassert.  In the long term it probably
208  * doesn't need to be on by default.
209  */
210 #ifdef USE_ASSERT_CHECKING
211 #define MEMORY_CONTEXT_CHECKING
212 #endif
213
214 /*
215  * Define this to force all parse and plan trees to be passed through
216  * copyObject(), to facilitate catching errors and omissions in
217  * copyObject().
218  */
219 /* #define COPY_PARSE_PLAN_TREES */
220
221 /*
222  * Enable debugging print statements for lock-related operations.
223  */
224 /* #define LOCK_DEBUG */
225
226 /*
227  * Enable debugging print statements for WAL-related operations; see
228  * also the wal_debug GUC var.
229  */
230 /* #define WAL_DEBUG */
231
232 /*
233  * Enable tracing of resource consumption during sort operations;
234  * see also the trace_sort GUC var.  For 8.1 this is enabled by default.
235  */
236 #define TRACE_SORT 1
237
238 /*
239  * Other debug #defines (documentation, anyone?)
240  */
241 /* #define HEAPDEBUGALL */
242 /* #define ACLDEBUG */
243 /* #define RTDEBUG */