Received: from localhost (unknown [200.46.204.183]) by developer.postgresql.org (Postfix) with ESMTP id 3A52D2E006F for ; Thu, 15 May 2008 09:54:24 -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 78153-03-5 for ; Thu, 15 May 2008 09:54:10 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail01.enterprisedb.com (mail01.enterprisedb.com [63.246.7.168]) by developer.postgresql.org (Postfix) with ESMTP id B24F02E0087 for ; Thu, 15 May 2008 09:52:36 -0300 (ADT) thread-index: Aci2iqXO1WdKv2zWS0+D15kJKSyQjA== 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 08:53:17 -0400 Message-ID: <482C320F.9070908@enterprisedb.com> Date: Thu, 15 May 2008 13:52:31 +0100 From: "Heikki Linnakangas" Organization: EnterpriseDB User-Agent: Mozilla-Thunderbird 2.0.0.12 (X11/20080420) MIME-Version: 1.0 To: "Matthew Wakeling" Cc: 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> In-Reply-To: Content-Type: text/plain; format=flowed; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 15 May 2008 12:53:18.0062 (UTC) FILETIME=[A5A168E0:01C8B68A] X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200805/205 X-Sequence-Number: 30173 Matthew Wakeling wrote: > Is it really safe to update the hint bits in place? If there is a power > cut in the middle of writing a block, is there a guarantee from the disc > that the block will never be garbled? Don't know, to be honest. We've never seen any reports of corrupted data that would suggest such a problem, but it doesn't seem impossible to me that some exotic storage system might do that. > Is there a way to make a shortcut and have the hint bits written the > first time the data is written to the table? One piece of obvious > low-hanging fruit would be to enhance step five above, so that the > bgwriter or checkpoint that writes the data to the database table checks > the pg_clog and writes the correct hint bits. Yep, that's an idea that's been suggested before. In fact, I seem to remember a patch to do just that. Don't remember what happened to it, > In fact, if the tuple's > creating transaction has aborted, then the tuple can be vacuumed right > there and then before it is even written. Not if you have any indexes on the table. To vacuum, you'll have to scan all indexes to remove pointers to the tuple. > However, this idea does not deal well with bulk data loads, where the > data is checkpointed before transaction is committed or aborted. Yep, that's the killer :-(. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com