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

Commit88b8110

Browse files
committed
Turn autovacuum on by default. (stats_row_level is also on by default.)
Threshold and scale factor are cut in half for more aggressive behavior.
1 parentea2e263 commit88b8110

File tree

4 files changed

+29
-26
lines changed

4 files changed

+29
-26
lines changed

‎doc/src/sgml/config.sgml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $PostgreSQL: pgsql/doc/src/sgml/config.sgml,v 1.75 2006/08/17 23:04:03 tgl Exp $ -->
1+
<!-- $PostgreSQL: pgsql/doc/src/sgml/config.sgml,v 1.76 2006/08/28 13:37:18 petere Exp $ -->
22

33
<chapter Id="runtime-config">
44
<title>Server Configuration</title>
@@ -383,7 +383,7 @@ SET ENABLE_SEQSCAN TO OFF;
383383
</para>
384384

385385
<para>
386-
The default value is2. The value must be less than the value of
386+
The default value is3. The value must be less than the value of
387387
<varname>max_connections</varname>. This parameter can only be
388388
set at server start.
389389
</para>
@@ -2990,7 +2990,8 @@ SELECT * FROM parent WHERE key = 2400;
29902990
<listitem>
29912991
<para>
29922992
Enables the collection of row-level statistics on database
2993-
activity. This parameter is off by default.
2993+
activity. This parameter is on by default, because the autovacuum
2994+
daemon needs the collected information.
29942995
Only superusers can change this setting.
29952996
</para>
29962997
</listitem>
@@ -3113,7 +3114,7 @@ SELECT * FROM parent WHERE key = 2400;
31133114
<para>
31143115
Specifies the minimum number of updated or deleted tuples needed
31153116
to trigger a <command>VACUUM</> in any one table.
3116-
The default is1000.
3117+
The default is500.
31173118
This parameter can only be set in the <filename>postgresql.conf</>
31183119
file or on the server command line.
31193120
This setting can be overridden for individual tables by entries in
@@ -3131,7 +3132,7 @@ SELECT * FROM parent WHERE key = 2400;
31313132
<para>
31323133
Specifies the minimum number of inserted, updated or deleted tuples
31333134
needed to trigger an <command>ANALYZE</> in any one table.
3134-
The default is500.
3135+
The default is250.
31353136
This parameter can only be set in the <filename>postgresql.conf</>
31363137
file or on the server command line.
31373138
This setting can be overridden for individual tables by entries in
@@ -3150,7 +3151,7 @@ SELECT * FROM parent WHERE key = 2400;
31503151
Specifies a fraction of the table size to add to
31513152
<varname>autovacuum_vacuum_threshold</varname>
31523153
when deciding whether to trigger a <command>VACUUM</>.
3153-
The default is 0.4.
3154+
The default is 0.2.
31543155
This parameter can only be set in the <filename>postgresql.conf</>
31553156
file or on the server command line.
31563157
This setting can be overridden for individual tables by entries in
@@ -3169,7 +3170,7 @@ SELECT * FROM parent WHERE key = 2400;
31693170
Specifies a fraction of the table size to add to
31703171
<varname>autovacuum_analyze_threshold</varname>
31713172
when deciding whether to trigger an <command>ANALYZE</>.
3172-
The default is 0.2.
3173+
The default is 0.1.
31733174
This parameter can only be set in the <filename>postgresql.conf</>
31743175
file or on the server command line.
31753176
This setting can be overridden for individual tables by entries in

‎doc/src/sgml/maintenance.sgml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $PostgreSQL: pgsql/doc/src/sgml/maintenance.sgml,v 1.59 2006/08/04 04:07:38 momjian Exp $ -->
1+
<!-- $PostgreSQL: pgsql/doc/src/sgml/maintenance.sgml,v 1.60 2006/08/28 13:37:18 petere Exp $ -->
22

33
<chapter id="maintenance">
44
<title>Routine Database Maintenance Tasks</title>
@@ -447,14 +447,14 @@ HINT: Stop the postmaster and use a standalone backend to VACUUM in "mydb".
447447
</sect2>
448448

449449
<sect2 id="autovacuum">
450-
<title id="autovacuum-title">Theauto-vacuum daemon</title>
450+
<title id="autovacuum-title">Theautovacuum daemon</title>
451451

452452
<indexterm>
453453
<primary>autovacuum</primary>
454454
<secondary>general information</secondary>
455455
</indexterm>
456456
<para>
457-
Beginning in <productname>PostgreSQL </productname> 8.1, there is a
457+
There is a
458458
separate optional server process called the <firstterm>autovacuum
459459
daemon</firstterm>, whose purpose is to automate the execution of
460460
<command>VACUUM</command> and <command>ANALYZE </command> commands.
@@ -465,7 +465,9 @@ HINT: Stop the postmaster and use a standalone backend to VACUUM in "mydb".
465465
linkend="guc-stats-start-collector"> and <xref
466466
linkend="guc-stats-row-level"> are set to <literal>true</literal>. Also,
467467
it's important to allow a slot for the autovacuum process when choosing
468-
the value of <xref linkend="guc-superuser-reserved-connections">.
468+
the value of <xref linkend="guc-superuser-reserved-connections">. In
469+
the default configuration, autovacuuming is enabled and the related
470+
configuration parameters are appropriately set.
469471
</para>
470472

471473
<para>

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

Lines changed: 8 additions & 8 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.343 2006/08/17 23:04:06 tgl Exp $
13+
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.344 2006/08/28 13:37:18 petere Exp $
1414
*
1515
*--------------------------------------------------------------------
1616
*/
@@ -707,7 +707,7 @@ static struct config_bool ConfigureNamesBool[] =
707707
NULL
708708
},
709709
&pgstat_collect_tuplelevel,
710-
false,NULL,NULL
710+
true,NULL,NULL
711711
},
712712
{
713713
{"stats_block_level",PGC_SUSET,STATS_COLLECTOR,
@@ -744,7 +744,7 @@ static struct config_bool ConfigureNamesBool[] =
744744
NULL
745745
},
746746
&autovacuum_start_daemon,
747-
false,NULL,NULL
747+
true,NULL,NULL
748748
},
749749

750750
{
@@ -1138,7 +1138,7 @@ static struct config_int ConfigureNamesInt[] =
11381138
NULL
11391139
},
11401140
&ReservedBackends,
1141-
2,0,INT_MAX /4,NULL,NULL
1141+
3,0,INT_MAX /4,NULL,NULL
11421142
},
11431143

11441144
{
@@ -1563,15 +1563,15 @@ static struct config_int ConfigureNamesInt[] =
15631563
NULL
15641564
},
15651565
&autovacuum_vac_thresh,
1566-
1000,0,INT_MAX,NULL,NULL
1566+
500,0,INT_MAX,NULL,NULL
15671567
},
15681568
{
15691569
{"autovacuum_analyze_threshold",PGC_SIGHUP,AUTOVACUUM,
15701570
gettext_noop("Minimum number of tuple inserts, updates or deletes prior to analyze."),
15711571
NULL
15721572
},
15731573
&autovacuum_anl_thresh,
1574-
500,0,INT_MAX,NULL,NULL
1574+
250,0,INT_MAX,NULL,NULL
15751575
},
15761576

15771577
{
@@ -1726,15 +1726,15 @@ static struct config_real ConfigureNamesReal[] =
17261726
NULL
17271727
},
17281728
&autovacuum_vac_scale,
1729-
0.4,0.0,100.0,NULL,NULL
1729+
0.2,0.0,100.0,NULL,NULL
17301730
},
17311731
{
17321732
{"autovacuum_analyze_scale_factor",PGC_SIGHUP,AUTOVACUUM,
17331733
gettext_noop("Number of tuple inserts, updates or deletes prior to analyze as a fraction of reltuples."),
17341734
NULL
17351735
},
17361736
&autovacuum_anl_scale,
1737-
0.2,0.0,100.0,NULL,NULL
1737+
0.1,0.0,100.0,NULL,NULL
17381738
},
17391739

17401740
/* End-of-list marker */

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
# Note: increasing max_connections costs ~400 bytes of shared memory per
6060
# connection slot, plus lock space (see max_locks_per_transaction). You
6161
# might also need to raise shared_buffers to support more connections.
62-
#superuser_reserved_connections =2# (change requires restart)
62+
#superuser_reserved_connections =3# (change requires restart)
6363
#unix_socket_directory = ''# (change requires restart)
6464
#unix_socket_group = ''# (change requires restart)
6565
#unix_socket_permissions = 0777# octal
@@ -345,7 +345,7 @@
345345
#stats_start_collector = on# needed for block or row stats
346346
# (change requires restart)
347347
#stats_block_level = off
348-
#stats_row_level =off
348+
#stats_row_level =on
349349
#stats_reset_on_server_start = off# (change requires restart)
350350

351351

@@ -361,15 +361,15 @@
361361
# AUTOVACUUM PARAMETERS
362362
#---------------------------------------------------------------------------
363363

364-
#autovacuum =off# enable autovacuum subprocess?
364+
#autovacuum =on# enable autovacuum subprocess?
365365
#autovacuum_naptime = 60# time between autovacuum runs, in secs
366-
#autovacuum_vacuum_threshold =1000# min # of tuple updates before
366+
#autovacuum_vacuum_threshold =500# min # of tuple updates before
367367
# vacuum
368-
#autovacuum_analyze_threshold =500# min # of tuple updates before
368+
#autovacuum_analyze_threshold =250# min # of tuple updates before
369369
# analyze
370-
#autovacuum_vacuum_scale_factor = 0.4# fraction of rel size before
370+
#autovacuum_vacuum_scale_factor = 0.2# fraction of rel size before
371371
# vacuum
372-
#autovacuum_analyze_scale_factor = 0.2# fraction of rel size before
372+
#autovacuum_analyze_scale_factor = 0.1# fraction of rel size before
373373
# analyze
374374
#autovacuum_vacuum_cost_delay = -1# default vacuum cost delay for
375375
# autovac, -1 means use

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp