Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id B9CFD6331EA for ; Sat, 1 May 2010 14:11:49 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 42621-09 for ; Sat, 1 May 2010 17:11:42 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.17.9]) by mail.postgresql.org (Postfix) with ESMTP id 923E4633141 for ; Sat, 1 May 2010 14:11:42 -0300 (ADT) Received: from [192.168.0.105] (pool-96-244-14-10.bltmmd.fios.verizon.net [96.244.14.10]) by mrelayeu.kundenserver.de (node=mrbap1) with ESMTP (Nemesis) id 0M5rAH-1NBEcF2Rth-00xWtd; Sat, 01 May 2010 19:11:07 +0200 Message-ID: <4BDC60A9.60108@2ndquadrant.com> Date: Sat, 01 May 2010 13:11:05 -0400 From: Greg Smith User-Agent: Thunderbird 2.0.0.24 (X11/20100317) MIME-Version: 1.0 To: Robert Haas CC: Josh Berkus , Rick , pgsql-performance@postgresql.org Subject: Re: autovacuum strategy / parameters References: <65d9d15d-41d2-4bfa-8cc3-6148b4fb9022@z3g2000yqz.googlegroups.com> <4BDB5ECE.4010607@agliodbs.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V01U2FsdGVkX1/EkTmBTxji7J73q+ES1QJo7esqOTfk7QyqTOZ gqctOWvCZFDskXZ6tpvrXF/O48CYWaP2rKQsYqBOjY7kAM6N24 s13vK41LycvyC85JdSEEUZtayxvPNUp X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.63 tagged_above=-10 required=5 tests=AWL=0.270, BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201005/7 X-Sequence-Number: 38591 Robert Haas wrote: > I don't have a stake in the ground on what the right settings are, but > I think it's fair to say that if you vacuum OR analyze much less > frequently than what we recommend my default, it might break. > I think the default settings are essentially minimum recommended frequencies. They aren't too terrible for the giant data warehouse case Josh was suggesting they came from--waiting until there's 20% worth of dead stuff before kicking off an intensive vacuum is OK when vacuum is expensive and you're mostly running big queries anyway. And for smaller tables, the threshold helps it kick in a little earlier. It's unlikely anyone wants to *increase* those, so that autovacuum runs even less; out of the box it's not tuned to run very often at all. If anything, I'd expect people to want to increase how often it runs, for tables where much less than 20% dead is a problem. The most common situation I've seen where that's the case is when you have a hotspot of heavily updated rows in a large table, and this may match some of the situations that Robert was alluding to seeing. Let's say you have a big table where 0.5% of the users each update their respective records heavily, averaging 30 times each. That's only going to result in 15% dead rows, so no autovacuum. But latency for those users will suffer greatly, because they might have to do lots of seeking around to get their little slice of the data. -- Greg Smith 2ndQuadrant US Baltimore, MD PostgreSQL Training, Services and Support greg@2ndQuadrant.com www.2ndQuadrant.us