Received: from magus.postgresql.org ([87.238.57.229]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TGtWm-0004pu-0L for pgsql-hackers@postgresql.org; Wed, 26 Sep 2012 15:27:56 +0000 Received: from smtprelay0137.b.hostedemail.com ([64.98.42.137] helo=smtprelay.b.hostedemail.com) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TGtWf-0003Al-L9 for pgsql-hackers@postgresql.org; Wed, 26 Sep 2012 15:27:55 +0000 Received: from filter.hostedemail.com (b-bigip1 [10.5.19.254]) by smtprelay01.b.hostedemail.com (Postfix) with SMTP id A87DB4CE95C7; Wed, 26 Sep 2012 15:27:47 +0000 (UTC) X-Panda: scanned! X-Spam-Summary: 50, 0, 0, , d41d8cd98f00b204, alvherre@alvh.no-ip.org, :::::, RULES_HIT:152:355:379:599:601:945:967:973:982:988:989:1260:1277:1311:1313:1345:1359:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2379:2393:2525:2553:2560:2563:2682:2685:2693:2857:2859:2892:2933:2937:2939:2942:2945:2947:2951:2954:3022:3027:3138:3139:3140:3141:3142:3353:3865:3866:3867:3868:3869:3870:3871:3872:3873:3874:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:4321:4470:4605:4659:5007:6261:7679:9025:9121:10004:10400:10848:10967:11256:11257:11658:11914:12517:12519:12740, 0, RBL:none, CacheIP:none, Bayesian:0.5, 0.5, 0.5, Netcheck:none, DomainCache:0, MSF:not bulk, SPF:fn, MSBL:0, DNSBL:none, Custom_rules:0:0:0 X-Session-Marker: 616C76686572726540616C76682E6E6F2D69702E6F7267 X-Filterd-Recvd-Size: 2122 Received: from perhan.alvh.no-ip.org (unknown [190.95.25.25]) (Authenticated sender: alvherre@alvh.no-ip.org) by omf06.b.hostedemail.com (Postfix) with ESMTPA; Wed, 26 Sep 2012 15:27:46 +0000 (UTC) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id B12626E02F; Wed, 26 Sep 2012 12:27:44 -0300 (CLST) Content-Type: text/plain; charset=UTF-8 Cc: Tomas Vondra , Pg Hackers Subject: Re: autovacuum stress-testing our system From: Alvaro Herrera To: Euler Taveira In-reply-to: <506316E7.7060303@timbira.com> References: <1718942738eb65c8407fcd864883f4c8@fuzzy.cz> <506316E7.7060303@timbira.com> Date: Wed, 26 Sep 2012 12:27:44 -0300 Message-Id: <1348673153-sup-4361@alvh.no-ip.org> User-Agent: Sup/git Content-Transfer-Encoding: quoted-printable X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201209/1040 X-Sequence-Number: 214068 Excerpts from Euler Taveira's message of mi=C3=A9 sep 26 11:53:27 -0300 2= 012: > On 26-09-2012 09:43, Tomas Vondra wrote: > > 5) splitting the single stat file into multiple pieces - e.g. per dat= abase, > > written separately, so that the autovacuum workers don't need to r= ead all > > the data even for databases that don't need to be vacuumed. This m= ight be > > combined with (4). > >=20 > IMHO that's the definitive solution. It would be one file per database = plus a > global one. That way, the check would only read the global.stat and pro= cess > those database that were modified. Also, an in-memory map could store t= hat > information to speed up the checks. +1 > The only downside I can see is that you > will increase the number of opened file descriptors. Note that most users of pgstat will only have two files open (instead of one as currently) -- one for shared, one for their own database. Only pgstat itself and autovac launcher would need to open pgstat files for all databases; but both do not have a need to open other files (arbitrary tables) so this shouldn't be a major problem. --=20 =C3=81lvaro Herrera http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services