Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id 413BB682EAC for ; Sat, 3 Dec 2011 12:00:33 -0400 (AST) Received: from gwmta.wicourts.gov ([165.219.244.99] helo=gw.wicourts.gov) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RWs0q-0008Ch-TM for pgsql-performance@postgresql.org; Sat, 03 Dec 2011 16:00:32 +0000 Received: from Courts-MTA by gw.wicourts.gov with Novell_GroupWise; Sat, 03 Dec 2011 10:00:14 -0600 Message-Id: <4ED9F32A02000025000437EC@gw.wicourts.gov> X-Mailer: Novell GroupWise Internet Agent 8.0.1 Date: Sat, 03 Dec 2011 10:00:10 -0600 From: "Kevin Grittner" To: , Subject: Re: Question about VACUUM Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Pg-Spam-Score: -5.4 (-----) X-Archive-Number: 201112/20 X-Sequence-Number: 45820 Ernesto Qui=F1ones wrote: > Scott Marlowe wrote: >> Ernesto Qui=F1ones wrote: =20 >>> I want to know if it=27s possible to predict (calculate), how long >>> a VACUUM FULL process will consume in a table? =20 I don=27t think you said what version of PostgreSQL you=27re using.=20 VACUUM FULL prior to version 9.0 is not recommended for most situations, and can take days or weeks to complete where other methods of achieving the same end may take hours. If you have autovacuum properly configured, you will probably never need to run VACUUM FULL. =20 >> If you look at what iostat is doing while the vacuum full is >> running, and divide the size of the table by that k/sec you can >> get a good approximation of how long it will take. Do you have >> naptime set to anything above 0? >=20 > Thanks for the answer Scott, actually my autovacuum_naptime is 1h =20 Ah, well that right there is likely to put you into a position where you need to do painful extraordinary cleanup like VACUUM FULL. In most situation the autovacuum defaults are pretty good. Where they need to be adjusted, the normal things which are actually beneficial are to change the thresholds to allow more aggressive cleanup or (on low-powered hardware) to adjust the cost ratios so that performance is less affected by the autovacuum runs. When autovacuum is disabled or changed to a long interval, it almost always results in bloat and/or outdated statistics which cause much more pain than a more aggressive autovacuum regimine does. =20 > but I don=27t find naptime parameter for a manual vacuum =20 I=27m guessing that Scott was thinking of the vacuum_cost_delay setting: =20 http://www.postgresql.org/docs/current/interactive/runtime-config-resource.= html=23GUC-VACUUM-COST-DELAY =20 -Kevin