Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 4CA939FC8AE for ; Tue, 5 Jun 2007 10:22:05 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 32433-02 for ; Tue, 5 Jun 2007 10:21:41 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from mail.libertyrms.com (vgateway.libertyrms.info [207.219.45.62]) by postgresql.org (Postfix) with ESMTP id 962E79FC0AD for ; Tue, 5 Jun 2007 10:12:52 -0300 (ADT) Received: from dba5.int.libertyrms.com ([10.1.3.44]) by mail.libertyrms.com with esmtp (Exim 4.22) id 1HvYq7-0004j9-J3; Tue, 05 Jun 2007 09:12:47 -0400 Subject: Re: the right time to vacuum database? From: Brad Nicholson To: "Charles.Hou" Cc: pgsql-admin@postgresql.org In-Reply-To: <1181039589.643323.59660@r19g2000prf.googlegroups.com> References: <1181039589.643323.59660@r19g2000prf.googlegroups.com> Content-Type: text/plain Date: Tue, 05 Jun 2007 09:12:47 -0400 Message-Id: <1181049167.27654.55.camel@dba5.int.libertyrms.com> Mime-Version: 1.0 X-Mailer: Evolution 2.8.1 Content-Transfer-Encoding: 7bit X-SA-Exim-Mail-From: bnichols@ca.afilias.info X-SA-Exim-Scanned: No; SAEximRunCond expanded to false X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.271 tagged_above=0 required=5 tests=AWL=0.135, BAYES_50=0.001, FORGED_RCVD_HELO=0.135 X-Spam-Level: X-Archive-Number: 200706/26 X-Sequence-Number: 25694 On Tue, 2007-06-05 at 03:33 -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. Have you looked at autovaccum? It can handle this for you. If not, you need to examine the output of VACUUM VERBOSE or pg_stattuple (in contrib) and set a policy based on the output. It's entirely possible that some tables will need to get vacuumed frequently, and others will not. -- Brad Nicholson 416-673-4106 Database Administrator, Afilias Canada Corp.