Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 962E29FB1DD for ; Tue, 17 Apr 2007 19:32:35 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 88542-07 for ; Tue, 17 Apr 2007 19:32:26 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 989679FB1B9 for ; Tue, 17 Apr 2007 19:32:30 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id l3HMWQjs015058; Tue, 17 Apr 2007 18:32:26 -0400 (EDT) To: Alvaro Herrera cc: Simon Riggs , pgsql-patches@postgresql.org Subject: Re: log_autovacuum In-reply-to: <20070417221804.GH15495@alvh.no-ip.org> References: <1173369949.3641.132.camel@silverbirch.site> <20070308175330.GW4715@alvh.no-ip.org> <1173378696.3641.162.camel@silverbirch.site> <20070417180633.GA15495@alvh.no-ip.org> <1176834315.3635.414.camel@silverbirch.site> <20070417184550.GC15495@alvh.no-ip.org> <20070417151004.f59498b0.wmoran@collaborativefusion.com> <9363.1176841144@sss.pgh.pa.us> <20070417204049.GD15495@alvh.no-ip.org> <20070417221804.GH15495@alvh.no-ip.org> Comments: In-reply-to Alvaro Herrera message dated "Tue, 17 Apr 2007 18:18:04 -0400" Date: Tue, 17 Apr 2007 18:32:26 -0400 Message-ID: <15057.1176849146@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200704/420 X-Sequence-Number: 1987 Alvaro Herrera writes: > Alvaro Herrera wrote: >> Tom Lane wrote: >>> BTW, shouldn't the log entry distinguish whether this was VACUUM, >>> ANALYZE, or both? >> >> We don't actually log anything for ANALYZE (the logging code is in >> lazy_vacuum_rel). >> >> Maybe it should be in autovacuum.c. Actually, I had misunderstood where you were proposing to put this. I believe that where you have it, the elapsed-time indication will only cover the VACUUM step; so it's not relevant to this code whether an ANALYZE would happen too. My suggestion is that you add similar but independent logging to analyze.c, controlled by the same min-duration variable. So the log output would treat autovac and autoanalyze as two independently loggable operations. I don't think there's much to print about an autoanalyze except its runtime ... well, maybe you could print the numbers of rows sampled and estimated, but I dunno if it matters. The point of doing it is just to be able to track what the heck autovacuum is doing ... regards, tom lane