Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 946cf22

Browse files
committed
Support rewritten-based full vacuum as VACUUM FULL. Traditional
VACUUM FULL was renamed to VACUUM FULL INPLACE. Also added a new option -i, --inplace for vacuumdb to perform FULL INPLACE vacuuming. Since the new VACUUM FULL uses CLUSTER infrastructure, we cannot use it for system tables. VACUUM FULL for system tables always fall back into VACUUM FULL INPLACE silently. Itagaki Takahiro, reviewed by Jeff Davis and Simon Riggs.
1 parent 28f6cab commit 946cf22

File tree

11 files changed

+406
-133
lines changed

11 files changed

+406
-133
lines changed

doc/src/sgml/ref/vacuum.sgml

+23-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$PostgreSQL: pgsql/doc/src/sgml/ref/vacuum.sgml,v 1.56 2009/11/16 21:32:06 tgl Exp $
2+
$PostgreSQL: pgsql/doc/src/sgml/ref/vacuum.sgml,v 1.57 2010/01/06 05:31:13 itagaki Exp $
33
PostgreSQL documentation
44
-->
55

@@ -21,7 +21,7 @@ PostgreSQL documentation
2121

2222
<refsynopsisdiv>
2323
<synopsis>
24-
VACUUM [ ( { FULL | FREEZE | VERBOSE | ANALYZE } [, ...] ) ] [ <replaceable class="PARAMETER">table</replaceable> [ (<replaceable class="PARAMETER">column</replaceable> [, ...] ) ] ]
24+
VACUUM [ ( { FULL [ INPLACE ] | FREEZE | VERBOSE | ANALYZE } [, ...] ) ] [ <replaceable class="PARAMETER">table</replaceable> [ (<replaceable class="PARAMETER">column</replaceable> [, ...] ) ] ]
2525
VACUUM [ FULL ] [ FREEZE ] [ VERBOSE ] [ <replaceable class="PARAMETER">table</replaceable> ]
2626
VACUUM [ FULL ] [ FREEZE ] [ VERBOSE ] ANALYZE [ <replaceable class="PARAMETER">table</replaceable> [ (<replaceable class="PARAMETER">column</replaceable> [, ...] ) ] ]
2727
</synopsis>
@@ -86,6 +86,27 @@ VACUUM [ FULL ] [ FREEZE ] [ VERBOSE ] ANALYZE [ <replaceable class="PARAMETER">
8686
Selects <quote>full</quote> vacuum, which can reclaim more
8787
space, but takes much longer and exclusively locks the table.
8888
</para>
89+
<para>
90+
For user tables, all table data and indexes are rewritten. This
91+
method requires extra disk space in which to write the new data,
92+
and is generally useful when a significant amount of space needs
93+
to be reclaimed from within the table.
94+
</para>
95+
<para>
96+
For system tables, all table data and indexes are modified in
97+
place to reclaim space. This method may require less disk space
98+
for the table data than <command>VACUUM FULL</command> on a
99+
comparable user table, but the indexes will grow which may
100+
counteract that benefit. Additionally, the operation is often
101+
slower than <command>VACUUM FULL</command> on a comparable user
102+
table.
103+
</para>
104+
<para>
105+
If <literal>FULL INPLACE</literal> is specified, the space is
106+
reclaimed in the same manner as a system table, even if it is a
107+
user table. Specifying <literal>INPLACE</literal> explicitly is
108+
rarely useful.
109+
</para>
89110
</listitem>
90111
</varlistentry>
91112

doc/src/sgml/ref/vacuumdb.sgml

+13-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$PostgreSQL: pgsql/doc/src/sgml/ref/vacuumdb.sgml,v 1.46 2010/01/06 02:59:44 momjian Exp $
2+
$PostgreSQL: pgsql/doc/src/sgml/ref/vacuumdb.sgml,v 1.47 2010/01/06 05:31:13 itagaki Exp $
33
PostgreSQL documentation
44
-->
55

@@ -24,6 +24,7 @@ PostgreSQL documentation
2424
<command>vacuumdb</command>
2525
<arg rep="repeat"><replaceable>connection-option</replaceable></arg>
2626
<group><arg>--full</arg><arg>-f</arg></group>
27+
<group><arg>--inplace</arg><arg>-i</arg></group>
2728
<group><arg>--freeze</arg><arg>-F</arg></group>
2829
<group><arg>--verbose</arg><arg>-v</arg></group>
2930
<group><arg>--analyze</arg><arg>-z</arg></group>
@@ -37,6 +38,7 @@ PostgreSQL documentation
3738
<arg rep="repeat"><replaceable>connection-options</replaceable></arg>
3839
<group><arg>--all</arg><arg>-a</arg></group>
3940
<group><arg>--full</arg><arg>-f</arg></group>
41+
<group><arg>--inplace</arg><arg>-i</arg></group>
4042
<group><arg>--freeze</arg><arg>-F</arg></group>
4143
<group><arg>--verbose</arg><arg>-v</arg></group>
4244
<group><arg>--analyze</arg><arg>-z</arg></group>
@@ -129,6 +131,16 @@ PostgreSQL documentation
129131
</listitem>
130132
</varlistentry>
131133

134+
<varlistentry>
135+
<term><option>-i</option></term>
136+
<term><option>--inplace</option></term>
137+
<listitem>
138+
<para>
139+
Perform <quote>full inplace</quote> vacuuming.
140+
</para>
141+
</listitem>
142+
</varlistentry>
143+
132144
<varlistentry>
133145
<term><option>-o</option></term>
134146
<term><option>--only-analyze</option></term>

0 commit comments

Comments
 (0)