Received: from localhost (unknown [200.46.204.183]) by developer.postgresql.org (Postfix) with ESMTP id 388C32E0084 for ; Thu, 15 May 2008 12:16:11 -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 73232-05 for ; Thu, 15 May 2008 12:15:57 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail01.enterprisedb.com (webmail.enterprisedb.com [63.246.7.168]) by developer.postgresql.org (Postfix) with ESMTP id BF6A22E0079 for ; Thu, 15 May 2008 12:15:57 -0300 (ADT) thread-index: Aci2nqxYmBff9lPhR1K0580n08h18A== Content-Class: urn:content-classes:message Importance: normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.4133 Received: from [192.168.1.33] ([82.2.54.3]) by mail01.enterprisedb.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Thu, 15 May 2008 11:16:36 -0400 Message-ID: <482C53A6.2030802@enterprisedb.com> Date: Thu, 15 May 2008 16:15:50 +0100 From: "Heikki Linnakangas" Organization: EnterpriseDB User-Agent: Mozilla-Thunderbird 2.0.0.12 (X11/20080420) MIME-Version: 1.0 To: "Alvaro Herrera" Cc: "Greg Smith" , "Pavan Deolasee" , Subject: Re: I/O on select count(*) References: <920841.71690.qm@web44808.mail.sp1.yahoo.com> <482B1D5F.EE98.0025.0@wicourts.gov> <20080515020553.GN9838@alvh.no-ip.org> <2e78013d0805141940x50c3f51u439019e8e592959@mail.gmail.com> <20080515144106.GA8221@alvh.no-ip.org> In-Reply-To: <20080515144106.GA8221@alvh.no-ip.org> Content-Type: text/plain; format=flowed; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit X-OriginalArrivalTime: 15 May 2008 15:16:36.0437 (UTC) FILETIME=[AAA95050:01C8B69E] X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200805/216 X-Sequence-Number: 30184 Alvaro Herrera wrote: > Greg Smith escribió: >> On Thu, 15 May 2008, Pavan Deolasee wrote: >> >>> I had suggested in the past that whenever we set hint bits for a tuple, >>> we should check all other tuples in the page and set their hint bits >>> too to avoid multiple writes of the same page. I guess the idea got >>> rejected because of lack of benchmarks to prove the benefit. >> >> From glancing at http://www.postgresql.org/docs/faqs.TODO.html I got the >> impression the idea was to have the background writer get involved to >> help with this particular situation. > > The problem is that the bgwriter does not understand about the content > of the pages it is writing -- they're opaque pages for all it knows. So > it cannot touch the hint bits. We know what kind of a relation we're dealing with in ReadBuffer, so we could add a flag to BufferDesc to mark heap pages. > If we had the bitmask in a separate map fork, this could be cheap. I don't buy that. The point of a hint bit is that it's right there along with the tuple you're looking at. If you have to look at a separate buffer, you might as well just look at clog. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com