Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 9677D2E00C3 for ; Tue, 11 Mar 2008 11:35:07 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 16628-08 for ; Tue, 11 Mar 2008 11:34:57 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from main2.mycybernet.net (main2.mycybernet.net [209.222.63.140]) by postgresql.org (Postfix) with ESMTP id 6C4D82E0183 for ; Tue, 11 Mar 2008 11:34:57 -0300 (ADT) Received: from 227-54-222-209.mycybernet.net ([209.222.54.227] helo=crankycanuck.ca) by main2.mycybernet.net with esmtp (Exim 4.62) (envelope-from ) id 1JZ5Yz-0008LK-6I for pgsql-performance@postgresql.org; Tue, 11 Mar 2008 10:34:45 -0400 Received: by crankycanuck.ca (Postfix, from userid 1000) id EB9E750190; Tue, 11 Mar 2008 10:34:39 -0400 (EDT) Date: Tue, 11 Mar 2008 10:34:39 -0400 From: Andrew Sullivan To: pgsql-performance@postgresql.org Subject: Re: count * performance issue Message-ID: <20080311143439.GA1465@crankycanuck.ca> Mail-Followup-To: Andrew Sullivan , pgsql-performance@postgresql.org References: <200803071727.36146.josh@agliodbs.com> <13345.1204940295@sss.pgh.pa.us> <87r6eia9tz.fsf@oxford.xeocode.com> <12ba3bf00803101354w15b023e1o237f564a1b01105f@mail.gmail.com> <36af4bed0803101957u6078127fq78dc3384fe78de5d@mail.gmail.com> <20080311093537.a60e2e3d.wmoran@collaborativefusion.com> <47D690A2.2090509@wildenhain.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.13 (2006-08-11) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200803/234 X-Sequence-Number: 29188 On Tue, Mar 11, 2008 at 02:19:09PM +0000, Matthew wrote: > of rows with IS NULL, then someone changes a row, then you find the count > of rows with IS NOT NULL. Add the two together, and there may be rows that > were counted twice, or not at all. Only if you count in READ COMMITTED. A