Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 5705E64FCE3 for ; Thu, 18 Dec 2008 09:07:40 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 26887-02 for ; Thu, 18 Dec 2008 09:07:37 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from lists.commandprompt.com (host-159.commandprompt.net [207.173.203.159]) by mail.postgresql.org (Postfix) with ESMTP id 64B9864FCED for ; Thu, 18 Dec 2008 09:07:37 -0400 (AST) Received: from perhan.alvh.no-ip.org (190-95-20-42.bk17-dsl.surnet.cl [190.95.20.42]) (authenticated bits=0) by lists.commandprompt.com (8.13.8/8.13.8) with ESMTP id mBIDCemc009219 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 18 Dec 2008 05:12:43 -0800 Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 7590447CCD; Thu, 18 Dec 2008 10:07:30 -0300 (CLST) Date: Thu, 18 Dec 2008 10:07:30 -0300 From: Alvaro Herrera To: Stefano Nichele Cc: pgsql-admin@postgresql.org Subject: Re: tracking last_autovacuum Message-ID: <20081218130730.GC5447@alvh.no-ip.org> References: <494A49CA.4050905@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <494A49CA.4050905@gmail.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0 (lists.commandprompt.com [207.173.203.159]); Thu, 18 Dec 2008 05:12:44 -0800 (PST) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200812/144 X-Sequence-Number: 30977 Stefano Nichele escribió: > Hi All, > in pg_stat_all_tables, the fields last_autovacuum, last_autoanalyze are > updated any time autovacuum vacuums a table. > I would like to keep an history of these activities in order to see when > and how many times any single table is vacuumed. > > Is there any features that can help me ? (I'm using postgres 8.2.9) > > What about creating a trigger on pg_stat_all_tables and storing the > required info in another table (like autovacuum_history) ? I guess you could run a query once every autovacuum_naptime and have it save aside all those entries from pg_stat_all_tables that have recent dates into a history table. -- Alvaro Herrera http://www.CommandPrompt.com/ The PostgreSQL Company - Command Prompt, Inc.