Received: from localhost (unknown [200.46.204.183]) by developer.postgresql.org (Postfix) with ESMTP id 688632E00DD for ; Wed, 28 May 2008 07:08:23 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 58097-04 for ; Wed, 28 May 2008 07:08:15 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from oxford.xeocode.com (87-127-95-198.no-dns-yet.enta.net [87.127.95.198]) by developer.postgresql.org (Postfix) with ESMTP id BD8962E00DC for ; Wed, 28 May 2008 07:08:18 -0300 (ADT) Received: from localhost ([127.0.0.1] helo=oxford.xeocode.com) by oxford.xeocode.com with esmtp (Exim 4.69) (envelope-from ) id 1K1IZo-0001pR-Kp; Wed, 28 May 2008 06:08:12 -0400 To: "Tom Lane" Cc: "Simon Riggs" , "pgsql-hackers" Subject: Re: Hint Bits and Write I/O In-Reply-To: <15901.1211931165@sss.pgh.pa.us> (Tom Lane's message of "Tue\, 27 May 2008 19\:32\:45 -0400") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) X-Draft-From: ("nnimap+mail01.enterprisedb.com:INBOX.hackers" 22578) References: <1211916951.4489.232.camel@ebony.site> <15901.1211931165@sss.pgh.pa.us> From: Gregory Stark Organization: EnterpriseDB Date: Wed, 28 May 2008 06:08:12 -0400 Message-ID: <87hccispv7.fsf@oxford.xeocode.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200805/863 X-Sequence-Number: 118862 "Tom Lane" writes: > (Although that argument might not hold water for a bulk seqscan: you'll > have hinted all the tuples and then very possibly throw the page away > immediately. That seems like precisely the case where we don't want to dirty the buffer. > So counting the hints and eventually deciding we did > enough to justify dirtying the page might be worth doing.) What if we counted how many hint bits were *not* set? I feel like the goal should be to dirty the buffer precisely once when all the bits can be set. The problem case is when we dirty the page but still have some hint bits to be set on a subsequent iteration. Of course that doesn't deal with the case where tuples are being touched continuously. Perhaps the idea should be to treat the page as dirty every n hint bit settings where n is the number of tuples on the page. or highest number of unset hint bits seen on the page. or something like that. -- Gregory Stark EnterpriseDB http://www.enterprisedb.com Ask me about EnterpriseDB's On-Demand Production Tuning