Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 3A85F9FA48A for ; Sun, 26 Nov 2006 21:01:47 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-new, port 10024) with ESMTP id 91915-08 for ; Sun, 26 Nov 2006 21:01:39 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from noel.decibel.org (noel.decibel.org [67.100.216.10]) by postgresql.org (Postfix) with ESMTP id A984B9FA3D0 for ; Sun, 26 Nov 2006 21:01:39 -0400 (AST) Received: by noel.decibel.org (Postfix, from userid 1001) id 088215643A; Sun, 26 Nov 2006 19:01:38 -0600 (CST) Received: (hashcash-sendmail, from uid 1001); Sun, 26 Nov 2006 19:01:35 -0600 Date: Sun, 26 Nov 2006 19:01:35 -0600 From: "Jim C. Nasby" To: Joost Kraaijeveld Cc: pgsql-performance@postgresql.org Subject: Re: When to vacuum a table? Message-ID: <20061127010135.GK39519@nasby.net> References: <1164540257.7902.0.camel@panoramix> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1164540257.7902.0.camel@panoramix> X-Operating-System: FreeBSD 6.1-RELEASE-p10 amd64 X-Distributed: Join the Effort! http://www.distributed.net User-Agent: Mutt/1.5.13 (2006-08-11) X-Hashcash: 1:20:061127:j.kraaijeveld@askesis.nl::RpIZ/0UU2Lc1QlHZ:0000000000000 0000000000000000000000002nAn X-Hashcash: 1:20:061127:pgsql-performance@postgresql.org::ic3ZIdZlQ0O/1BCu:00000 0000000000000000000000007Bnk X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200611/231 X-Sequence-Number: 22001 On Sun, Nov 26, 2006 at 12:24:17PM +0100, Joost Kraaijeveld wrote: > Hi, > > Are there guidelines (or any empirical data) available how to determine > how often a table should be vacuumed for optimum performance or is this > an experience / trial-and-error thing? Most of the time I just turn autovac on, set the scale factors to 0.2/0.1 and the thresholds to 300/200 and turn on vacuum_cost_delay (usually set to 20). That's a pretty decent setup for most applications. It also doesn't hurt to run a periodic vacuumdb -av and look at the tail end of it's output to make sure you have adequate FSM settings. The exception to that rule is for tables that are very small and have a lot of churn; I'll vacuum those by hand very frequently (every 60 seconds or better). -- Jim Nasby jim@nasby.net EnterpriseDB http://enterprisedb.com 512.569.9461 (cell)