Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id BE22B650EAE; Fri, 27 Jun 2008 11:57:54 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 77424-03; Fri, 27 Jun 2008 11:57:45 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from outmail128143.authsmtp.co.uk (outmail128143.authsmtp.co.uk [62.13.128.143]) by postgresql.org (Postfix) with ESMTP id 199A1650EAB; Fri, 27 Jun 2008 11:57:50 -0300 (ADT) Received: from mail-c187.authsmtp.com (mail-c187.authsmtp.com [62.13.128.33]) by punt3.authsmtp.com (8.14.2/8.14.2/Kp) with ESMTP id m5REvgbd084632; Fri, 27 Jun 2008 15:57:42 +0100 (BST) Received: from [192.168.0.3] (85-211-229-155.dyn.gotadsl.co.uk [85.211.229.155]) (authenticated bits=0) by mail.authsmtp.com (8.14.2/8.14.2/Kp) with ESMTP id m5REvZo6059658; Fri, 27 Jun 2008 15:57:35 +0100 (BST) Subject: Re: [HACKERS] Hint Bits and Write I/O From: Simon Riggs To: Gregory Stark Cc: Tom Lane , pgsql-hackers , List pgsql-patches In-Reply-To: <87hcbfq71p.fsf@oxford.xeocode.com> References: <1211916951.4489.232.camel@ebony.site> <15901.1211931165@sss.pgh.pa.us> <1213797209.9468.126.camel@ebony.site> <87hcbfq71p.fsf@oxford.xeocode.com> Content-Type: text/plain Date: Fri, 27 Jun 2008 16:02:18 +0100 Message-Id: <1214578938.3845.423.camel@ebony.site> Mime-Version: 1.0 X-Mailer: Evolution 2.12.0 Content-Transfer-Encoding: 7bit X-Server-Quench: 60db3cf3-4459-11dd-8155-001185d377ca X-AuthRoute: OCdxZQATClZOTQEd DAteCiNZVAwpPBRK HVkIKg5MJUcNSQVJ NksachtFagJbZ0xf HGQLW1xEUVh7XGR/ aA8fZQBDYEtPQQdo WVZIR1dNFgBqBAMB SEMbMGw0HVpAeHt5 Y0NqEHNZWEM0c0Yp EE0HQ24bYWNlYX0e URQMagtVdQZXfh9E a1h6AHAKZjZWKBg1 TUcAHxkaHhhlExEd YgALMRo4QFoQVjc6 S1g9BzQzEAUkAAJb X-Authentic-SMTP: 61633235383639.squirrel.dmpriest.net.uk:1078/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: 200806/195 X-Sequence-Number: 6681 On Fri, 2008-06-27 at 15:36 +0100, Gregory Stark wrote: > "Simon Riggs" writes: > > > The default and minimum value for this parameter is 1, so very similar to > > existing behaviour. Expected settings would be 2-5, possibly as high as 20, > > though those are just educated guesses. So the maximum is set arbitrarily as > > 100. > > Not a fan of arbitrary constants. ISTM this should just have a maximum of > MaxHeapTuplesPerPage. > > I'm not really happy with having this parameter at all. It's not something a > DBA can understand or have any hope of setting intelligently. I assume this is > a temporary measure until we have a better understanding of what real-world > factors affect the right values for this knob? Yes, its a guess at what sort of control we'll need. > > Temp buffers are never dirtied by hint bit setting. Most temp tables are > > written in a single command, so that re-accessing clog for temp tuples > > is seldom costly. This also changes current behaviour. > > I'm not sure I agree with this logic and it doesn't seem like temporary tables > are an important enough case to start coming up with special cases which may > help or may hurt. Most people use temporary tables the way you describe but > I'm sure there's someone out there using temporary tables in a radically > different fashion. Thanks for your comments. The patch splits into two parts: * the machinery to *not* dirty a page when we set hints * behaviour modifications now that we can tell the difference between dirty and hinted pages Nobody has yet come up with any comments about the first half, which is good. The second part is clearly where much debate will occur. I'm going to literally split the patch into two, so we can get the machinery into CVS and then fiddle and argue over the second part over next few months. > I'm also a bit concerned that *how many hint bits* isn't enough information to > determine how important it is to write out the page. What about how old the > oldest transaction is which was hinted? Or how many *unhinted* xmin/xmax > values were found? If HTSV can hint xmin for a tuple but finds xmax still in > progress perhaps that's a good sign it's not worth dirtying the page? Sounds interesting. We can track anything and everything really, but we do need to come to a firm dirty/not decision at some point. If you can develop those ideas a bit more by Monday, I'll try to put them in the patch. (I'm away until then now). -- Simon Riggs www.2ndQuadrant.com PostgreSQL Training, Services and Support