X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 61ED6536EC for ; Fri, 15 Apr 2005 02:25:27 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 65193-01 for ; Fri, 15 Apr 2005 05:25:23 +0000 (GMT) Received: from stark.xeocode.com (stark.xeocode.com [216.58.44.227]) by svr1.postgresql.org (Postfix) with ESMTP id BB12D53689 for ; Fri, 15 Apr 2005 02:25:21 -0300 (ADT) Received: from localhost ([127.0.0.1] helo=stark.xeocode.com) by stark.xeocode.com with smtp (Exim 3.36 #1 (Debian)) id 1DMJKG-0002Bw-00; Fri, 15 Apr 2005 01:25:08 -0400 To: Tom Lane Cc: Greg Stark , Andrew Sullivan , pgsql-sql@postgresql.org Subject: Re: row-attribute in EXPLAIN-output doesn't match count(*) References: <200504141838.14705.andreak@officenet.no> <425EA496.2030501@archonet.com> <200504141921.38476.andreak@officenet.no> <20050414173358.GB9027@phlogiston.dyndns.org> <8764ypf8hy.fsf@stark.xeocode.com> <27509.1113521169@sss.pgh.pa.us> In-Reply-To: <27509.1113521169@sss.pgh.pa.us> From: Greg Stark Organization: The Emacs Conspiracy; member since 1992 Date: 15 Apr 2005 01:25:08 -0400 Message-ID: <87fyxsehmz.fsf@stark.xeocode.com> Lines: 27 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.008 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200504/216 X-Sequence-Number: 21109 Tom Lane writes: > We have to start the transaction no later than event #2 since there has > to be something to hold the lock. But it'd be easy enough to decouple > this from BEGIN, and it'd be good enough to solve the "COMMIT;BEGIN" > problem. Oh I think I finally figured out what you're saying here. So vacuum doesn't really know what tuples are actually visible to the snapshots actually taken by a transaction? It's making the conservative estimate that a snapshot could have been taken as early as the start of the transaction even if no snapshot was taken until later? > Which of these three times do you think now() ought to correspond to? > I recall having argued that it should be event #3 since that corresponds > to the database snapshot you see. 100% backwards compatibility would > require setting now() at event #1, but will anyone weep if we change that? I think it would be weird to perform a select and see records with dates after now(). It would also be weird to perform a select and not see records inserted before now(). I'm not sure any of the above guarantees those criteria for READ COMMITTED mode, but I think I'm on the same general path as you. -- greg