Received: from magus.postgresql.org ([87.238.57.229]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TH0PH-0002es-SF for pgsql-hackers@postgresql.org; Wed, 26 Sep 2012 22:48:39 +0000 Received: from [2001:1528:137::f1] (helo=mail.gransy.com) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TH0PG-0001ce-KV for pgsql-hackers@postgresql.org; Wed, 26 Sep 2012 22:48:39 +0000 Received: from antispam.gransy.com (antispam.gransy.com [77.78.104.124]) by mail.gransy.com (Postfix) with ESMTP id 05612508ABA for ; Thu, 27 Sep 2012 00:48:35 +0200 (CEST) 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 67ux6BAMlUvK for ; Thu, 27 Sep 2012 00:48:34 +0200 (CEST) Received: by mail.gransy.com (Postfix, from userid 5000) id E55E9508ABC; Thu, 27 Sep 2012 00:48:34 +0200 (CEST) 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 7B845508ABA for ; Thu, 27 Sep 2012 00:48:34 +0200 (CEST) Message-ID: <50638642.2080606@fuzzy.cz> Date: Thu, 27 Sep 2012 00:48:34 +0200 From: Tomas Vondra User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120713 Thunderbird/14.0 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: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2001:1528:137::f1 (failed) X-Pg-Spam-Score: -1.1 (-) X-Archive-Number: 201209/1060 X-Sequence-Number: 214088 On 26.9.2012 18:29, Tom Lane wrote: > Alvaro Herrera writes: >> Excerpts from Euler Taveira's message of mi=C3=A9 sep 26 11:53:27 -030= 0 2012: >>> On 26-09-2012 09:43, Tomas Vondra wrote: >>>> 5) splitting the single stat file into multiple pieces - e.g. per da= tabase, >>>> written separately, so that the autovacuum workers don't need to rea= d all >>>> the data even for databases that don't need to be vacuumed. This mig= ht be >>>> combined with (4). >=20 >>> IMHO that's the definitive solution. It would be one file per databas= e plus a >>> global one. That way, the check would only read the global.stat and p= rocess >>> those database that were modified. Also, an in-memory map could store= that >>> information to speed up the checks. >=20 >> +1 >=20 > That would help for the case of hundreds of databases, but how much > does it help for lots of tables in a single database? Well, it wouldn't, but it wouldn't make it worse either. Or at least that's how I understand it. > I'm a bit suspicious of the idea that we should encourage people to use > hundreds of databases per installation anyway: the duplicated system > catalogs are going to be mighty expensive, both in disk space and in > their cache footprint in shared buffers. There was some speculation > at the last PGCon about how we might avoid the duplication, but I think > we're years away from any such thing actually happening. You don't need to encourage us to do that ;-) We know it's not perfect and considering a good alternative - e.g. several databases (~10) with schemas inside, replacing the current database-only approach. This way we'd get multiple stat files (thus gaining the benefits) with less overhead (shared catalogs). And yes, using tens of thousands of tables (serving as "caches") for a reporting solution is "interesting" (as in the old Chinese curse) too. > 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. Yes, I've proposed something like this in my original mail - setting a "dirty" flag on objects (a database in this case) whenever a table in it gets eligible for vacuum/analyze. Tomas