Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id 2662E18FE98F for ; Thu, 1 Dec 2011 18:35:55 -0400 (AST) Received: from [2404:130:0:10::40:2] (helo=mail.catalyst.net.nz) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RWFEQ-0005zt-A9 for pgsql-performance@postgresql.org; Thu, 01 Dec 2011 22:35:55 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.catalyst.net.nz (Postfix) with ESMTP id 4A63232A51 for ; Fri, 2 Dec 2011 11:35:39 +1300 (NZDT) X-Virus-Scanned: Debian amavisd-new at catalyst.net.nz Received: from mail.catalyst.net.nz ([127.0.0.1]) by localhost (bertrand.catalyst.net.nz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id fW0BprzIaSNU for ; Fri, 2 Dec 2011 11:35:38 +1300 (NZDT) Received: from [IPv6:2404:130:0:1000:222:15ff:fe5c:2471] (unknown [IPv6:2404:130:0:1000:222:15ff:fe5c:2471]) (Authenticated sender: mark.kirkwood) by mail.catalyst.net.nz (Postfix) with ESMTPSA id 97F9F32A50 for ; Fri, 2 Dec 2011 11:35:38 +1300 (NZDT) Message-ID: <4ED80128.80600@catalyst.net.nz> Date: Fri, 02 Dec 2011 11:35:20 +1300 From: Mark Kirkwood User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20111124 Thunderbird/8.0 MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Re: Autovacuum Issue References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 2404:130:0:10::40:2 (failed) X-Pg-Spam-Score: -1.1 (-) X-Archive-Number: 201112/6 X-Sequence-Number: 45806 On 02/12/11 07:18, Robert Haas wrote: > > And also please share your views on my decision about disable autovacuum for > my application. I am planning to run vacuum command daily on that small > table which has frequent updates. > Sounds like a bad plan. > If the table has frequent updates vacuuming once a day will not control space bloat from dead rows... so your small table's storage will become a very large (even though there are only a few undeleted rows), and performance will become terrible. I would suggest tuning autovacuum to wakeup more frequently (c.f autovacuum_naptime parameter), so your small table stays small. Also you didn't mention what version of Postgres you are running. In 8.4 and later vacuum (hence autovacuum) is much smarter about finding dead rows to clean up, and should have less impact. You can also control the load autovacuum puts on your system (c.f autovacuum_vacuum_cost_delay parameter). regards Mark