Received: from magus.postgresql.org ([87.238.57.229]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TaE3G-00020v-13 for pgsql-hackers@postgresql.org; Sun, 18 Nov 2012 23:13:22 +0000 Received: from [2001:1528:137::f1] (helo=mail.gransy.com) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TaE3F-0003uL-AM for pgsql-hackers@postgresql.org; Sun, 18 Nov 2012 23:13:21 +0000 Received: from antispam.gransy.com (antispam.gransy.com [77.78.104.124]) by mail.gransy.com (Postfix) with ESMTP id 06339508A77 for ; Mon, 19 Nov 2012 00:13:21 +0100 (CET) Received: from mail.gransy.com ([82.208.44.189]) by antispam.gransy.com (antispam.gransy.com [77.78.104.124]) (amavisd-new, port 10024) with ESMTP id R-zJoWsGboRu for ; Mon, 19 Nov 2012 00:12:46 +0100 (CET) Received: by mail.gransy.com (Postfix, from userid 5000) id E9EAC508A7A; Mon, 19 Nov 2012 00:13:20 +0100 (CET) Received: from [192.168.1.237] (ip-78-45-133-255.net.upcbroadband.cz [78.45.133.255]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.gransy.com (Postfix) with ESMTPSA id B8067508A77 for ; Mon, 19 Nov 2012 00:13:20 +0100 (CET) Message-ID: <50A96B91.1050409@fuzzy.cz> Date: Mon, 19 Nov 2012 00:13:21 +0100 From: Tomas Vondra User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121026 Thunderbird/16.0.2 MIME-Version: 1.0 To: pgsql-hackers@postgresql.org Subject: Re: autovacuum stress-testing our system References: <1718942738eb65c8407fcd864883f4c8@fuzzy.cz> <506316E7.7060303@timbira.com> <1348673153-sup-4361@alvh.no-ip.org> <26698.1348676957@sss.pgh.pa.us> In-Reply-To: <26698.1348676957@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-2 Content-Transfer-Encoding: 7bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 2001:1528:137::f1 (failed) X-Pg-Spam-Score: -1.1 (-) X-Archive-Number: 201211/985 X-Sequence-Number: 216837 On 26.9.2012 18:29, Tom Lane wrote: > What seems to me like it could help more is fixing things so that the > autovac launcher needn't even launch a child process for databases that > haven't had any updates lately. I'm not sure how to do that, but it > probably involves getting the stats collector to produce some kind of > summary file. Couldn't we use the PgStat_StatDBEntry for this? By splitting the pgstat.stat file into multiple pieces (see my other post in this thread) there's a file with StatDBEntry items only, so maybe it could be used as the summary file ... I've been thinking about this: (a) add "needs_autovacuuming" flag to PgStat_(TableEntry|StatDBEntry) (b) when table stats are updated, run quick check to decide whether the table needs to be processed by autovacuum (vacuumed or analyzed), and if yes then set needs_autovacuuming=true and both for table and database The worker may read the DB entries from the file and act only on those that need to be processed (those with needs_autovacuuming=true). Maybe the DB-level field might be a counter of tables that need to be processed, and the autovacuum daemon might act on those first? Although the simpler the better I guess. Or did you mean something else? regards Tomas