Received: from localhost (unknown [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id AB39A2E0F8F for ; Wed, 14 Nov 2007 18:46:30 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 41903-03 for ; Wed, 14 Nov 2007 18:46:22 -0400 (AST) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 35EB52E1C5B for ; Wed, 14 Nov 2007 18:46:26 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.1/8.14.1) with ESMTP id lAEMkOIE017000; Wed, 14 Nov 2007 17:46:24 -0500 (EST) To: Russell Smith cc: Jean-David Beyer , pgsql-performance@postgresql.org Subject: Re: Curious about dead rows. In-reply-to: <473B6C9D.1020804@pws.com.au> 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> Comments: In-reply-to Russell Smith message dated "Thu, 15 Nov 2007 08:46:05 +1100" Date: Wed, 14 Nov 2007 17:46:24 -0500 Message-ID: <16999.1195080384@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200711/226 X-Sequence-Number: 27641 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, seeing a few not-yet-committed rows would be unsurprising. 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. regards, tom lane