Received: from localhost (unknown [200.46.204.183]) by developer.postgresql.org (Postfix) with ESMTP id 10EE32E0049 for ; Fri, 16 May 2008 15:22:41 -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 02459-06 for ; Fri, 16 May 2008 15:22:31 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from outmail128171.authsmtp.com (outmail128171.authsmtp.com [62.13.128.171]) by developer.postgresql.org (Postfix) with ESMTP id 643512E002E for ; Fri, 16 May 2008 15:22:33 -0300 (ADT) Received: from mail-c188.authsmtp.com (mail-c188.authsmtp.com [62.13.128.25]) by punt2.authsmtp.com (8.13.8/8.13.8/Kp) with ESMTP id m4GIMFfT076313; Fri, 16 May 2008 19:22:15 +0100 (BST) Received: from [192.168.0.6] (85-211-226-243.dyn.gotadsl.co.uk [85.211.226.243]) (authenticated bits=0) by mail.authsmtp.com (8.14.2/8.14.2/Kp) with ESMTP id m4GIME2i046502; Fri, 16 May 2008 19:22:14 +0100 (BST) Subject: Re: I/O on select count(*) From: Simon Riggs To: Greg Smith Cc: Alvaro Herrera , Matthew Wakeling , pgsql-performance@postgresql.org In-Reply-To: References: <920841.71690.qm@web44808.mail.sp1.yahoo.com> <482B1D5F.EE98.0025.0@wicourts.gov> <20080515020553.GN9838@alvh.no-ip.org> <20080515155232.GC8221@alvh.no-ip.org> Content-Type: text/plain Date: Fri, 16 May 2008 19:23:55 +0100 Message-Id: <1210962235.18922.109.camel@ebony.site> Mime-Version: 1.0 X-Mailer: Evolution 2.12.0 Content-Transfer-Encoding: 7bit X-Server-Quench: 02563408-2375-11dd-aecc-001871e930f4 X-AuthRoute: OCdxZQATClZOTQEd DAteCiNZVAwpPBRK HVkIKg5MJUcNSQVJ NksachtFaQNbYFhI HGQLW1xEUVR7W2F/ ag4fZQBDYEtPQQdo VlZLRlFNFgB3AVJc AmlnL2xwLgVCfntw ZwhjWHRcEkR4cEB+ Rk5cCG8FYmJ9aWFL BF0JIlAHbQNKfxdC awV2V3NbZStlM3Bw LDceBR4WBxBqYAUS ZUkKKxoJTEIGFSJ0 TBcfGylvXwxt X-Authentic-SMTP: 61633235383639.cat.dmpriest.net.uk:953/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: 200805/251 X-Sequence-Number: 30219 On Fri, 2008-05-16 at 14:05 -0400, Greg Smith wrote: > After reading the code and that documentation a bit, the part I'm > still not sure about is whether the CLOG entry is created when the XID > is assigned and then kept current as the state changes, or whether > that isn't even in CLOG until the transaction is committed. It seems > like the latter, but there's some ambiguity in the wording and too > many code paths for me to map right now. Alvaro already said this, I thought? The clog is updated only at sub or main transaction end, thank goodness. When the transactionid is assigned the page of the clog that contains that transactionid is checked to see if it already exists and if not, it is initialised. -- Simon Riggs www.2ndQuadrant.com PostgreSQL Training, Services and Support