Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 0CF8163335F for ; Mon, 4 Jan 2010 17:53:43 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 85027-06 for ; Mon, 4 Jan 2010 21:53:32 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from polaris.pinpointresearch.com (66-7-238-130.static-ip.telepacific.net [66.7.238.130]) by mail.postgresql.org (Postfix) with ESMTP id 71256632BEC for ; Mon, 4 Jan 2010 17:53:32 -0400 (AST) Received: from betelgeuse.pinpointresearch.com (betelgeuse.pinpointresearch.com [192.168.1.179]) by polaris.pinpointresearch.com (Postfix) with ESMTP id 02B88E047AF6; Mon, 4 Jan 2010 13:53:29 -0800 (PST) Message-ID: <4B426359.9040601@pinpointresearch.com> Date: Mon, 04 Jan 2010 13:53:29 -0800 From: Steve Crawford User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Madison Kelly CC: Brad Nicholson , Gary Doades , pgsql-performance@postgresql.org Subject: Re: DB is slow until DB is reloaded References: <4B423D22.7040803@alteeve.com> <4B424215.70605@pinpointresearch.com> <4B424FF6.40207@alteeve.com> <4B425222.7070905@gpdnet.co.uk> <4B425555.6020709@alteeve.com> <1262638856.29852.4.camel@bnicholson-desktop> <4B425E93.1050207@alteeve.com> In-Reply-To: <4B425E93.1050207@alteeve.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=3.189 tagged_above=-10 required=5 tests=BAYES_50=0.001, FH_DATE_PAST_20XX=3.188 X-Spam-Level: *** X-Archive-Number: 201001/21 X-Sequence-Number: 36901 Madison Kelly wrote: > > I wanted to get ahead of the problem, hence my question here. :) > I've set this to run at night ('iwt' being the DB in question): > > su postgres -c "psql iwt -c \"VACUUM ANALYZE VERBOSE\" And why not the vacuumdb command?: su postgres -c "vacuumdb --analyze --verbose iwt" But this is duct-tape and bailing-wire. You REALLY need to make sure that autovacuum is running - you are likely to have much better results with less pain. Cheers, Steve