Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 99935B5DBB6 for ; Thu, 9 Jun 2011 13:52:22 -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 03575-04 for ; Thu, 9 Jun 2011 16:52:10 +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 5F5B1B5D90E for ; Thu, 9 Jun 2011 13:52:10 -0300 (ADT) Received: from [192.168.1.3] (mail.highperformancepostgresql.com [71.179.240.8]) by mrelayeu.kundenserver.de (node=mreu1) with ESMTP (Nemesis) id 0MeOeR-1QCkdT3BPz-00Q83m; Thu, 09 Jun 2011 18:52:09 +0200 Message-ID: <4DF0FA36.2010802@2ndquadrant.com> Date: Thu, 09 Jun 2011 12:52:06 -0400 From: Greg Smith User-Agent: Thunderbird 2.0.0.24 (X11/20100317) MIME-Version: 1.0 To: "Reuven M. Lerner" CC: pgsql-performance@postgresql.org Subject: Re: Triggering autovacuum References: <4DF0E5A0.7080101@lerner.co.il> In-Reply-To: <4DF0E5A0.7080101@lerner.co.il> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:JOkAv1ZOP0a652lOdVkf8RrR2evvMID3PVBzzfRNbMF qDKP4upp9PtVoZdaE8VObLDBiEtpQS0XXfA5P6GjQPgVt1agL+ zlE2xD7uPeJ8rS2KnHisYE8c7hxxU+zNZHNRCUYh0AfUbmfWtd UNkr7SKLujC1v0YMPixlt+Pj0X1VCPzxISYN/VOy5wzee4xpCO X2bDMakUo/9Iq/hQ97VNTM0H/bXlJUmSgSgS782Vkg= 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: 201106/104 X-Sequence-Number: 44037 Reuven M. Lerner wrote: > Could this be because we're only doing INSERTs and SELECTs? In such a > case, then we would never reach the threshold of modified tuples that > autovacuum looks for, and thus it would never run. That would, by my > reasoning, mean that we'll never tag dead tuples (which isn't a big > deal if we're never deleting or updating rows), but also that we'll > never run ANALYZE as part of autovacuum. Which would mean that we'd > be running with out-of-date statistics. The computation for whether the auto-analyze portion of autovacuum runs takes into account INSERT traffic, so the stats don't go too far out of data on this style of workload. The one for the vacuum work only considers dead rows. So your case should be seeing regular entries for the last auto-analyze, but possibly not for last auto-vacuum. Eventually autovacuum will kick in anyway for transaction id wraparound, and that might be traumatic when it does happen. You might want to schedule periodic manual vacuum on these tables to at least have that happen at a good time. Wraparound autovacuum has this bad habit of finally kicking in only during periods of peak busy on the server. -- Greg Smith 2ndQuadrant US greg@2ndQuadrant.com Baltimore, MD PostgreSQL Training, Services, and 24x7 Support www.2ndQuadrant.us "PostgreSQL 9.0 High Performance": http://www.2ndQuadrant.com/books