version 1, including all changes.
.
| Rev |
Author |
# |
Line |
| 1 |
perry |
1 |
VACUUMDB |
| |
|
2 |
!!!VACUUMDB |
| |
|
3 |
NAME |
| |
|
4 |
SYNOPSIS |
| |
|
5 |
DESCRIPTION |
| |
|
6 |
USAGE |
| |
|
7 |
---- |
| |
|
8 |
!!NAME |
| |
|
9 |
|
| |
|
10 |
|
| |
|
11 |
vacuumdb - garbage-collect and analyze a PostgreSQL database |
| |
|
12 |
!!SYNOPSIS |
| |
|
13 |
|
| |
|
14 |
|
| |
|
15 |
__vacuumdb__ [[ ''connection-options''... ] [[ [[ |
| |
|
16 |
__-d__ ] ''dbname'' ] [[ __--full__ | __-f__ ] [[ |
| |
|
17 |
__--verbose__ | __-v__ ] [[ __--analyze__ | |
| |
|
18 |
__-z__ ] [[ __--table '__''table'' [[ __(__ |
| |
|
19 |
''column'' __[[,...] )__ ]__'__ ] |
| |
|
20 |
|
| |
|
21 |
|
| |
|
22 |
__vacuumdb__ [[ ''connection-options''... ] [[ |
| |
|
23 |
__--all__ | __-a__ ] [[ __--full__ | __-f__ ] [[ |
| |
|
24 |
__--verbose__ | __-v__ ] [[ __--analyze__ | |
| |
|
25 |
__-z__ ] |
| |
|
26 |
|
| |
|
27 |
|
| |
|
28 |
__INPUTS__ |
| |
|
29 |
|
| |
|
30 |
|
| |
|
31 |
__vacuumdb__ accepts the following command line |
| |
|
32 |
arguments: |
| |
|
33 |
|
| |
|
34 |
|
| |
|
35 |
__-d__ ''dbname'' |
| |
|
36 |
|
| |
|
37 |
|
| |
|
38 |
__--dbname__ ''dbname'' |
| |
|
39 |
|
| |
|
40 |
|
| |
|
41 |
Specifies the name of the database to be cleaned or |
| |
|
42 |
analyzed. |
| |
|
43 |
|
| |
|
44 |
|
| |
|
45 |
__-a__ |
| |
|
46 |
|
| |
|
47 |
|
| |
|
48 |
__--all__ |
| |
|
49 |
|
| |
|
50 |
|
| |
|
51 |
Vacuum all databases. |
| |
|
52 |
|
| |
|
53 |
|
| |
|
54 |
__-f__ |
| |
|
55 |
|
| |
|
56 |
|
| |
|
57 |
__--full__ |
| |
|
58 |
|
| |
|
59 |
|
| |
|
60 |
Perform ``full'' vacuuming. |
| |
|
61 |
|
| |
|
62 |
|
| |
|
63 |
__-v__ |
| |
|
64 |
|
| |
|
65 |
|
| |
|
66 |
__--verbose__ |
| |
|
67 |
|
| |
|
68 |
|
| |
|
69 |
Print detailed information during processing. |
| |
|
70 |
|
| |
|
71 |
|
| |
|
72 |
__-z__ |
| |
|
73 |
|
| |
|
74 |
|
| |
|
75 |
__--analyze__ |
| |
|
76 |
|
| |
|
77 |
|
| |
|
78 |
Calculate statistics for use by the optimizer. |
| |
|
79 |
|
| |
|
80 |
|
| |
|
81 |
__-t__ ''table'' __[[ (__''column'' __[[,...]) |
| |
|
82 |
]__ |
| |
|
83 |
|
| |
|
84 |
|
| |
|
85 |
__--table__ ''table'' __[[ (__''column'' |
| |
|
86 |
__[[,...]) ]__ |
| |
|
87 |
|
| |
|
88 |
|
| |
|
89 |
Clean or analyze ''table'' only. Column names may be |
| |
|
90 |
specified only in conjunction with the __--analyze__ |
| |
|
91 |
option. |
| |
|
92 |
|
| |
|
93 |
|
| |
|
94 |
__Tip:__ If you specify columns to vacuum, you probably |
| |
|
95 |
have to escape the parentheses from the shell. |
| |
|
96 |
|
| |
|
97 |
|
| |
|
98 |
__vacuumdb__ also accepts the following command line |
| |
|
99 |
arguments for connection parameters: |
| |
|
100 |
|
| |
|
101 |
|
| |
|
102 |
__-h__ ''host'' |
| |
|
103 |
|
| |
|
104 |
|
| |
|
105 |
__--host__ ''host'' |
| |
|
106 |
|
| |
|
107 |
|
| |
|
108 |
Specifies the host name of the machine on which the server |
| |
|
109 |
is running. If host begins with a slash, it is used as the |
| |
|
110 |
directory for the Unix domain socket. |
| |
|
111 |
|
| |
|
112 |
|
| |
|
113 |
__-p__ ''port'' |
| |
|
114 |
|
| |
|
115 |
|
| |
|
116 |
__--port__ ''port'' |
| |
|
117 |
|
| |
|
118 |
|
| |
|
119 |
Specifies the Internet TCP/IP port or local Unix domain |
| |
|
120 |
socket file extension on which the server is listening for |
| |
|
121 |
connections. |
| |
|
122 |
|
| |
|
123 |
|
| |
|
124 |
__-U__ ''username'' |
| |
|
125 |
|
| |
|
126 |
|
| |
|
127 |
__--username__ ''username'' |
| |
|
128 |
|
| |
|
129 |
|
| |
|
130 |
User name to connect as |
| |
|
131 |
|
| |
|
132 |
|
| |
|
133 |
__-W__ |
| |
|
134 |
|
| |
|
135 |
|
| |
|
136 |
__--password__ |
| |
|
137 |
|
| |
|
138 |
|
| |
|
139 |
Force password prompt. |
| |
|
140 |
|
| |
|
141 |
|
| |
|
142 |
__-e__ |
| |
|
143 |
|
| |
|
144 |
|
| |
|
145 |
__--echo__ |
| |
|
146 |
|
| |
|
147 |
|
| |
|
148 |
Echo the commands that __vacuumdb__ generates and sends |
| |
|
149 |
to the server. |
| |
|
150 |
|
| |
|
151 |
|
| |
|
152 |
__-q__ |
| |
|
153 |
|
| |
|
154 |
|
| |
|
155 |
__--quiet__ |
| |
|
156 |
|
| |
|
157 |
|
| |
|
158 |
Do not display a response. |
| |
|
159 |
|
| |
|
160 |
|
| |
|
161 |
__OUTPUTS__ |
| |
|
162 |
|
| |
|
163 |
|
| |
|
164 |
__VACUUM__ |
| |
|
165 |
|
| |
|
166 |
|
| |
|
167 |
Everything went well. |
| |
|
168 |
|
| |
|
169 |
|
| |
|
170 |
__vacuumdb: Vacuum failed.__ |
| |
|
171 |
|
| |
|
172 |
|
| |
|
173 |
Something went wrong. __vacuumdb__ is only a wrapper |
| |
|
174 |
script. See VACUUM [[__vacuum__(l)] and psql(1) for |
| |
|
175 |
a detailed discussion of error messages and potential |
| |
|
176 |
problems. |
| |
|
177 |
!!DESCRIPTION |
| |
|
178 |
|
| |
|
179 |
|
| |
|
180 |
__vacuumdb__ is a utility for cleaning a PostgreSQL |
| |
|
181 |
database. __vacuumdb__ will also generate internal |
| |
|
182 |
statistics used by the PostgreSQL query |
| |
|
183 |
optimizer. |
| |
|
184 |
|
| |
|
185 |
|
| |
|
186 |
__vacuumdb__ is a shell script wrapper around the backend |
| |
|
187 |
command VACUUM [[__vacuum__(l)] via the PostgreSQL |
| |
|
188 |
interactive terminal psql(1). There is no effective |
| |
|
189 |
difference between vacuuming databases via this or other |
| |
|
190 |
methods. __psql__ must be found by the script and a |
| |
|
191 |
database server must be running at the targeted host. Also, |
| |
|
192 |
any default settings and environment variables available to |
| |
|
193 |
__psql__ and the __libpq__ front-end library do |
| |
|
194 |
apply. |
| |
|
195 |
!!USAGE |
| |
|
196 |
|
| |
|
197 |
|
| |
|
198 |
To clean the database test: |
| |
|
199 |
|
| |
|
200 |
|
| |
|
201 |
$ __vacuumdb test |
| |
|
202 |
__ |
| |
|
203 |
|
| |
|
204 |
|
| |
|
205 |
To clean and analyze for the optimizer a database named |
| |
|
206 |
bigdb: |
| |
|
207 |
|
| |
|
208 |
|
| |
|
209 |
$ __vacuumdb --analyze bigdb |
| |
|
210 |
__ |
| |
|
211 |
|
| |
|
212 |
|
| |
|
213 |
To clean a single table foo in a database named xyzzy, and |
| |
|
214 |
analyze a single column bar of the table for the |
| |
|
215 |
optimizer: |
| |
|
216 |
|
| |
|
217 |
|
| |
|
218 |
$ __vacuumdb --analyze --verbose --table 'foo(bar)' xyzzy |
| |
|
219 |
__ |
| |
|
220 |
---- |