Received: from localhost (unknown [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id BB9522E2D8E for ; Wed, 14 Nov 2007 23:26:20 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 77384-01 for ; Wed, 14 Nov 2007 23:26:15 -0400 (AST) Received: from vms044pub.verizon.net (vms044pub.verizon.net [206.46.252.44]) by postgresql.org (Postfix) with ESMTP id 9B28B2E2D8A for ; Wed, 14 Nov 2007 23:26:15 -0400 (AST) Received: from [192.168.0.251] ([71.251.196.74]) by vms044.mailsrvcs.net (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) with ESMTPA id <0JRJ0019P2VE0421@vms044.mailsrvcs.net> for pgsql-performance@postgresql.org; Wed, 14 Nov 2007 21:26:03 -0600 (CST) Date: Wed, 14 Nov 2007 22:26:02 -0500 From: Jean-David Beyer Subject: Re: Curious about dead rows. In-reply-to: <16999.1195080384@sss.pgh.pa.us> To: pgsql-performance@postgresql.org Message-id: <473BBC4A.20304@verizon.net> Organization: Institute for Regimented Whimsey MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1 Content-transfer-encoding: 7bit X-Enigmail-Version: 0.94.0.0 References: <4735DBDB.5050208@verizon.net> <16627.1194714491@sss.pgh.pa.us> <4735FA9F.1080805@verizon.net> <473A5CC0.3060003@verizon.net> <473AE63D.7090305@verizon.net> <20071114152249.GA16041@crankycanuck.ca> <473B2A1F.30804@verizon.net> <473B6C9D.1020804@pws.com.au> <16999.1195080384@sss.pgh.pa.us> User-Agent: Thunderbird 1.5.0.9 (X11/20070317) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200711/231 X-Sequence-Number: 27646 Tom Lane wrote: > Russell Smith writes: >> It is possible that analyze is not getting the number of dead rows >> right? > > Hah, I think you are on to something. ANALYZE is telling the truth about > how many "dead" rows it saw, but its notion of "dead" is "not good > according to SnapshotNow". Thus, rows inserted by a not-yet-committed > transaction would be counted as dead. So if these are background > auto-analyzes being done in parallel with inserting transactions that run > for awhile, They are. > seeing a few not-yet-committed rows would be unsurprising. That is a very interesting possibility. I can see that it is certainly a possible explanation, since my insert transactions take between 0.04 to 0.1 minutes (sorry, decimal stopwatch) of real time, typically putting 1700 rows into about a half dozen tables. And the ANALYZE is whatever autovacuum chooses to do. So if new not-yet-committed rows are considered dead, that would be a sufficient explanation. So I am, retroactively, unsurprised. > I wonder if that is worth fixing? I'm not especially concerned about the > cosmetic aspect of it, but if we mistakenly launch an autovacuum on the > strength of an inflated estimate of dead rows, that could be costly. > Well, since I was more interested in the explanation than in the fixing, in that sense I do not care if it is fixed or not. While it may create a slight slowdown (if it is an error), the applications run "fast enough." I would not even get the fix until Red Hat get around to putting it in (I run postgresql-8.1.9-1.el5 that is in their RHEL5 distribution), that probably will not be until RHEL6 and the soonest, and I will probably skip that one and wait until RHEL7 comes out in about 3 years. But somewhere perhaps a reminder of this should be placed where someone like me would find it, so we would not have to go through this again for someone else. -- .~. Jean-David Beyer Registered Linux User 85642. /V\ PGP-Key: 9A2FC99A Registered Machine 241939. /( )\ Shrewsbury, New Jersey http://counter.li.org ^^-^^ 22:05:01 up 22 days, 15:23, 0 users, load average: 4.16, 4.22, 4.10