X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 1149CD1B4EB for ; Fri, 14 Nov 2003 20:39:23 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 62492-03 for ; Fri, 14 Nov 2003 16:38:53 -0400 (AST) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id B374AD1B4E1 for ; Fri, 14 Nov 2003 16:38:47 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.10/8.12.10) with ESMTP id hAEKck19004988; Fri, 14 Nov 2003 15:38:47 -0500 (EST) To: Will LaShell Cc: Hannu Krosing , Christopher Browne , pgsql-performance@postgresql.org Subject: Re: Help with count(*) In-reply-to: <3FB52FA7.8060508@lashell.net> References: <200311141251.38786.mallah@trade-india.com> <1068831807.2540.44.camel@fuji.krosing.net> <3FB52FA7.8060508@lashell.net> Comments: In-reply-to Will LaShell message dated "Fri, 14 Nov 2003 12:40:23 -0700" Date: Fri, 14 Nov 2003 15:38:46 -0500 Message-ID: <4987.1068842326@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200311/119 X-Sequence-Number: 4679 Will LaShell writes: > Hannu Krosing wrote: >> Can't the backend be made to delay the "real" start of transaction until >> the first query gets executed ? > That seems counter intuitive doesn't it? Why write more code in the > server when the client is the thing that has the problem? Because there are a lot of clients with the same problem :-( A more principled argument is that we already postpone the setting of the transaction snapshot until the first query arrives within the transaction. In a very real sense, the setting of the snapshot *is* the start of the transaction. So it would make sense if incidental stuff like VACUUM also thought that the transaction hadn't started until the first query arrives. (I believe the previous discussion also agreed that we wanted to postpone the freezing of now(), which currently also happens at BEGIN rather than the first command after BEGIN.) regards, tom lane