Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit57e0847

Browse files
committed
Change default commit_delay to zero, update documentation.
1 parent33cc5d8 commit57e0847

File tree

4 files changed

+24
-16
lines changed

4 files changed

+24
-16
lines changed

‎doc/src/sgml/wal.sgml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/wal.sgml,v 1.1 2001/01/24 23:15:19 petere Exp $ -->
1+
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/wal.sgml,v 1.2 2001/02/18 04:50:43 tgl Exp $ -->
22

33
<chapter id="wal">
44
<title>Write-Ahead Logging (<acronym>WAL</acronym>)</title>
@@ -290,15 +290,15 @@
290290
</para>
291291

292292
<para>
293-
The <varname>COMMIT_DELAY</varname> parameter defines for howlong
294-
the backend willbe forced tosleep after writing a commit record
295-
to the log with <function>LogInsert</function> call but before
293+
The <varname>COMMIT_DELAY</varname> parameter defines for howmany
294+
microsecondsthe backend will sleep after writing a commit
295+
recordto the log with <function>LogInsert</function> but before
296296
performing a <function>LogFlush</function>. This delay allows other
297297
backends to add their commit records to the log so as to have all
298298
of them flushed with a single log sync. Unfortunately, this
299299
mechanism is not fully implemented at release 7.1, so there is at
300-
present nopoint in changing this parameterfromits default value
301-
of 5 microseconds.
300+
presentusuallynobenefit to be gainedfromincreasing this parameter
301+
above its default value of zero.
302302
</para>
303303
</sect1>
304304
</chapter>

‎src/backend/access/transam/xact.c

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/access/transam/xact.c,v 1.96 2001/01/24 19:42:51 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/access/transam/xact.c,v 1.97 2001/02/18 04:50:43 tgl Exp $
1212
*
1313
* NOTES
1414
*Transaction aborts can now occur two ways:
@@ -221,7 +221,7 @@ intXactIsoLevel;
221221

222222
#include"access/xlogutils.h"
223223

224-
intCommitDelay=5;/*1/200000 sec */
224+
intCommitDelay=0;/*in microseconds */
225225

226226
staticvoid (*_RollbackFunc)(void*)=NULL;
227227
staticvoid*_RollbackData=NULL;
@@ -667,7 +667,6 @@ RecordTransactionCommit()
667667
{
668668
XLogRecDatardata;
669669
xl_xact_commitxlrec;
670-
structtimevaldelay;
671670
XLogRecPtrrecptr;
672671

673672
BufmgrCommit();
@@ -686,11 +685,20 @@ RecordTransactionCommit()
686685

687686
/*
688687
* Sleep before commit! So we can flush more than one
689-
* commit records per single fsync.
688+
* commit records per single fsync. (The idea is some other
689+
* backend may do the XLogFlush while we're sleeping. This
690+
* needs work however, because on most Unixen, the minimum
691+
* select() delay is 10msec or more, which is way too long.)
690692
*/
691-
delay.tv_sec=0;
692-
delay.tv_usec=CommitDelay;
693-
(void)select(0,NULL,NULL,NULL,&delay);
693+
if (CommitDelay>0)
694+
{
695+
structtimevaldelay;
696+
697+
delay.tv_sec=0;
698+
delay.tv_usec=CommitDelay;
699+
(void)select(0,NULL,NULL,NULL,&delay);
700+
}
701+
694702
XLogFlush(recptr);
695703
MyLastRecPtr.xrecoff=0;
696704

‎src/backend/utils/misc/guc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* Support for grand unified configuration scheme, including SET
55
* command, configuration file, and command line options.
66
*
7-
* $Header: /cvsroot/pgsql/src/backend/utils/misc/guc.c,v 1.29 2001/02/07 23:36:22 vadim Exp $
7+
* $Header: /cvsroot/pgsql/src/backend/utils/misc/guc.c,v 1.30 2001/02/18 04:50:43 tgl Exp $
88
*
99
* Copyright 2000 by PostgreSQL Global Development Group
1010
* Written by Peter Eisentraut <peter_e@gmx.net>.
@@ -291,7 +291,7 @@ ConfigureNamesInt[] =
291291
0,0,16},
292292

293293
{"commit_delay",PGC_USERSET,&CommitDelay,
294-
5,0,1000},
294+
0,0,100000},
295295

296296
{NULL,0,NULL,0,0,0}
297297
};

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108
#wal_buffers = 8 # min 4
109109
#wal_files = 0 # range 0-64
110110
#wal_debug = 0 # range 0-16
111-
#commit_delay =5 # range 0-1000
111+
#commit_delay =0 # range 0-100000
112112
#checkpoint_timeout = 300 # range 30-1800
113113

114114

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp