Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 0C6729FBFD7 for ; Tue, 5 Jun 2007 10:31:41 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 42610-02-4 for ; Tue, 5 Jun 2007 10:31:28 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from main2.mycybernet.net (main2.mycybernet.net [209.222.63.140]) by postgresql.org (Postfix) with ESMTP id 2DBEA9FC843 for ; Tue, 5 Jun 2007 10:25:53 -0300 (ADT) Received: from 227-54-222-209.mycybernet.net ([209.222.54.227] helo=phlogiston.dydns.org) by main2.mycybernet.net with esmtp (Exim 4.62) (envelope-from ) id 1HvZ2m-00013r-Au for pgsql-admin@postgresql.org; Tue, 05 Jun 2007 09:25:52 -0400 Received: by phlogiston.dydns.org (Postfix, from userid 1000) id CD7B3404E; Tue, 5 Jun 2007 09:25:46 -0400 (EDT) Date: Tue, 5 Jun 2007 09:25:46 -0400 From: Andrew Sullivan To: pgsql-admin@postgresql.org Subject: Re: the right time to vacuum database? Message-ID: <20070605132546.GI4818@phlogiston.dyndns.org> References: <1181039589.643323.59660@r19g2000prf.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1181039589.643323.59660@r19g2000prf.googlegroups.com> User-Agent: Mutt/1.5.9i X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200706/27 X-Sequence-Number: 25695 On Tue, Jun 05, 2007 at 03:33:09AM -0700, Charles.Hou wrote: > how can i know that it's the time to vacuumdb? i set the crontab to > vacuumdb 3 times in one day. because my database size increase from > 440MB to 460MB in 8 hours. You haven't told us enough. What's the churn on the database, to begin with? That's only 20M. If you replace approximately 20M in 8 hours, then it might be that the FSM is working perfectly, and this is the overhead that is reasonable to keep around to allow your database to work perfectly. Also, have you looked into autovacuum? It might take some of the guesswork out of this. Finally, I expect that most of your churn is in particular tables. Those are the ones you want to vacuum frequently. The rest of them aren't that interesting. The way to learn about this is to use VACUUM VERBOSE, which will give you information about how many pages it is recovering. A -- Andrew Sullivan | ajs@crankycanuck.ca "The year's penultimate month" is not in truth a good way of saying November. --H.W. Fowler