Skip to content

Commit 037709e

Browse files
committed
Reduce default value of max_prepared_transactions from 50 to 5. This
saves nearly 700kB in the default shared memory segment size, which seems worthwhile, and it is a feature that many users won't use anyway. Per Heikki's argument, there is no point in a compromise value --- those who are using 2PC at all will probably want it at least equal to max_connections. But we can't set it to zero by default without breaking the prepared_xacts regression test.
1 parent 8aec77f commit 037709e

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

doc/src/sgml/runtime.sgml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$PostgreSQL: pgsql/doc/src/sgml/runtime.sgml,v 1.348 2005/08/24 18:56:07 tgl Exp $
2+
$PostgreSQL: pgsql/doc/src/sgml/runtime.sgml,v 1.349 2005/08/29 21:38:17 tgl Exp $
33
-->
44

55
<chapter Id="runtime">
@@ -1179,7 +1179,7 @@ SET ENABLE_SEQSCAN TO OFF;
11791179
endterm="sql-prepare-transaction-title">).
11801180
Setting this parameter to zero disables the prepared-transaction
11811181
feature.
1182-
The default is 50.
1182+
The default is 5.
11831183
This option can only be set at server start.
11841184
</para>
11851185

src/backend/access/transam/twophase.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1994, Regents of the University of California
88
*
99
* IDENTIFICATION
10-
* $PostgreSQL: pgsql/src/backend/access/transam/twophase.c,v 1.10 2005/08/20 23:26:10 tgl Exp $
10+
* $PostgreSQL: pgsql/src/backend/access/transam/twophase.c,v 1.11 2005/08/29 21:38:18 tgl Exp $
1111
*
1212
* NOTES
1313
* Each global transaction is associated with a global transaction
@@ -64,7 +64,7 @@
6464
#define TWOPHASE_DIR "pg_twophase"
6565

6666
/* GUC variable, can't be changed after startup */
67-
int max_prepared_xacts = 50;
67+
int max_prepared_xacts = 5;
6868

6969
/*
7070
* This struct describes one global transaction that is in prepared state

src/backend/utils/misc/guc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* Written by Peter Eisentraut <peter_e@gmx.net>.
1111
*
1212
* IDENTIFICATION
13-
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.286 2005/08/22 17:34:59 momjian Exp $
13+
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.287 2005/08/29 21:38:18 tgl Exp $
1414
*
1515
*--------------------------------------------------------------------
1616
*/
@@ -1203,7 +1203,7 @@ static struct config_int ConfigureNamesInt[] =
12031203
NULL
12041204
},
12051205
&max_prepared_xacts,
1206-
50, 0, INT_MAX, NULL, NULL
1206+
5, 0, INT_MAX, NULL, NULL
12071207
},
12081208

12091209
#ifdef LOCK_DEBUG

src/backend/utils/misc/postgresql.conf.sample

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090

9191
#shared_buffers = 1000 # min 16 or max_connections*2, 8KB each
9292
#temp_buffers = 1000 # min 100, 8KB each
93-
#max_prepared_transactions = 50 # can be 0 or more
93+
#max_prepared_transactions = 5 # can be 0 or more
9494
#work_mem = 1024 # min 64, size in KB
9595
#maintenance_work_mem = 16384 # min 1024, size in KB
9696
#max_stack_depth = 2048 # min 100, size in KB

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy