Received: from localhost (unknown [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id B67602E414E for ; Thu, 13 Dec 2007 13:01:06 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 86750-02-3 for ; Thu, 13 Dec 2007 13:00:55 -0400 (AST) Received: from outmail128077.authsmtp.net (outmail128077.authsmtp.net [62.13.128.77]) by postgresql.org (Postfix) with ESMTP id A9C452E42DF for ; Thu, 13 Dec 2007 13:00:24 -0400 (AST) Received: from outmail128180.authsmtp.com (outmail128180.authsmtp.com [62.13.128.180]) by punt4.authsmtp.com (8.14.1/8.14.1/Kp) with ESMTP id lBDH0Kvd070393; Thu, 13 Dec 2007 17:00:21 GMT Received: from [192.168.0.3] (85-211-24-246.dyn.gotadsl.co.uk [85.211.24.246]) (authenticated bits=0) by mail.authsmtp.com (8.13.8/8.13.8/Kp) with ESMTP id lBDH0I8c006279; Thu, 13 Dec 2007 17:00:18 GMT Subject: Re: Heavy write activity on first vacuum of fresh TOAST data From: Simon Riggs To: Kevin Grittner Cc: Tom Lane , pgsql-performance@postgresql.org In-Reply-To: <47610BF3.EE98.0025.0@wicourts.gov> References: <4760FF69.EE98.0025.0@wicourts.gov> <1197562283.4255.1829.camel@ebony.site> <476108F2.EE98.0025.0@wicourts.gov> <476108F2.EE98.0025.0@wicourts.gov> <13267.1197563721@sss.pgh.pa.us> <47610BF3.EE98.0025.0@wicourts.gov> Content-Type: text/plain Date: Thu, 13 Dec 2007 17:00:42 +0000 Message-Id: <1197565242.4255.1853.camel@ebony.site> Mime-Version: 1.0 X-Mailer: Evolution 2.8.2 Content-Transfer-Encoding: 7bit X-Server-Quench: e23482ff-a99c-11dc-814e-001185d377ca X-AuthRoute: OCdxZQATClZOTQEd DAteCiNZVAwpPBRK HVkIKg5MJUcNSQVJ NksadRtFaQZbaVxS HGQLW1NEUVp7WWN/ agIfZQBDYEtPQQdu TkpNRE1QERpoT0Bz cmYeKxEhdwVAenl5 K0RiX3YVCUZ5cU5/ FBhJRGQPNnphaTRM TUhZc1ZJcANLfxdA PlN4UyBcLwdSbGoL JyIJERcLGAAXCClc XBBFMkgTXUtDFzUg Rg4DASRnGktNSSQp NABuNFcXAVsUekI8 eVU7VEkYeyM1IzZi fSBBCTNQT2wg X-Authentic-SMTP: 61633235383639.squirrel.dmpriest.net.uk:787/Kp X-Report-SPAM: If SPAM / abuse - report it at: http://www.authsmtp.com/abuse X-Virus-Status: No virus detected - but ensure you scan with your own anti-virus system! X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200712/190 X-Sequence-Number: 28006 On Thu, 2007-12-13 at 10:39 -0600, Kevin Grittner wrote: > >>> On Thu, Dec 13, 2007 at 10:35 AM, in message <13267.1197563721@sss.pgh.pa.us>, > Tom Lane wrote: > > "Kevin Grittner" writes: > >> ... although to a naive user it's not clear what > >> is known at vacuum time that the INSERT into the empty table > >> couldn't have inferred. > > > > The fact that the INSERT actually committed. > > Fair enough. I suppose that the possibility that of access before > the commit would preclude any optimization that would assume the > commit is more likely than a rollback, and do the extra work only in > the unusual case? No chance. There's an optimization of COPY I've not got around to as yet, but nothing straightforward we can do with the normal case. We might be able to have bgwriter set hint bits on dirty blocks, but the success of that would depend upon the transit time of blocks through the cache, i.e. it might be totally ineffective. So might be just overhead for the bgwriter and worse, could divert bgwriter attention away from what its supposed to be doing. That's a lot of work to fiddle with the knobs to improve things and there's higher things on the list AFAICS. -- Simon Riggs 2ndQuadrant http://www.2ndQuadrant.com