Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 27DE21337BC6 for ; Fri, 24 Sep 2010 15:05:53 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 28614-08-3 for ; Fri, 24 Sep 2010 18:05:46 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.187]) by mail.postgresql.org (Postfix) with ESMTP id B75351337BA6 for ; Fri, 24 Sep 2010 15:05:37 -0300 (ADT) Received: from [192.168.1.6] (static-71-179-240-8.bltmmd.fios.verizon.net [71.179.240.8]) by mrelayeu.kundenserver.de (node=mrbap0) with ESMTP (Nemesis) id 0Lpgco-1OKwTu0AQY-00fIFq; Fri, 24 Sep 2010 20:05:37 +0200 Message-ID: <4C9CE86E.6020100@2ndquadrant.com> Date: Fri, 24 Sep 2010 14:05:34 -0400 From: Greg Smith User-Agent: Thunderbird 2.0.0.24 (X11/20100317) MIME-Version: 1.0 To: Tobias Brox CC: Brad Nicholson , pgsql-performance@postgresql.org Subject: Re: Memory usage - indexes References: <865426.21884.qm@web39701.mail.mud.yahoo.com> <4C9CDCDD.8000603@ca.afilias.info> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:ECZwT/MN2cP7N0dxy1lsFqttMtuof1N8e5499P9l8cw jU7qHY23fETT4mPSUhP7nDVlzC+Ti3vNT1fKc9TYMPGR4LTiVJ JvPmBcznlKUCFEq5723gFdU524RNwlFFJVIrmyTXhNJkGZIrhe 9mnls2CgvFJ8bqww8BrClbzZxyGtMwz3QvGKG1xpJMWfltOn3E ZZho4PAWLezs4GFowKofveUxwQeuLLw2/8TY8khIis= X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201009/174 X-Sequence-Number: 40377 Tobias Brox wrote: > We do have some bloat-problems as well - every now and then we decide > to shut down the operation, use pg_dump to dump the entire database to > an sql file and restore it. The benefits are dramatic, the space > requirement goes down a lot, and often some of our > performance-problems goes away after such an operation. > You can do the same thing with far less trouble if you just CLUSTER the table. It takes a lock while it runs so there's still downtime needed, but it's far faster than a dump/reload and safer too. > If it was to me, we would have had autovacuum turned on. We've had > one bad experience when the autovacuumer decided to start vacuuming > one of the biggest table at the worst possible moment - and someone > figured autovacuum was a bad idea. I think we probably still would > need regular vacuums to avoid that happening, but with autovacuum on, > maybe we could have managed with regular vacuums only once a week or > so. > The answer to "we once saw autovacuum go mad and cause us problems" is never the knee-jerk "disable autovacuum", it's usually "change autovacuum so it runs far more often but with lower intesity". Sometimes it's "keep autovacuum on but proactively hit the biggest tables with manual vacuums at slow times" too. -- Greg Smith, 2ndQuadrant US greg@2ndQuadrant.com Baltimore, MD PostgreSQL Training, Services and Support www.2ndQuadrant.us Author, "PostgreSQL 9.0 High Performance" Pre-ordering at: https://www.packtpub.com/postgresql-9-0-high-performance/book