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 B81C653F7B for ; Thu, 14 Apr 2005 14:13:02 -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 19129-09 for ; Thu, 14 Apr 2005 17:12:58 +0000 (GMT) Received: from anchor-post-32.mail.demon.net (anchor-post-32.mail.demon.net [194.217.242.90]) by svr1.postgresql.org (Postfix) with ESMTP id 3B94153DF6 for ; Thu, 14 Apr 2005 14:12:57 -0300 (ADT) Received: from mwynhau.demon.co.uk ([193.237.186.96] helo=mainbox.archonet.com) by anchor-post-32.mail.demon.net with esmtp (Exim 4.42) id 1DM7tg-000GmQ-9Q; Thu, 14 Apr 2005 17:12:57 +0000 Received: from [192.168.1.17] (client17.archonet.com [192.168.1.17]) by mainbox.archonet.com (Postfix) with ESMTP id C820A1599D; Thu, 14 Apr 2005 18:12:55 +0100 (BST) Message-ID: <425EA496.2030501@archonet.com> Date: Thu, 14 Apr 2005 18:12:54 +0100 From: Richard Huxton User-Agent: Mozilla Thunderbird 1.0 (X11/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Andreas Joseph Krogh Cc: pgsql-sql@postgresql.org Subject: Re: row-attribute in EXPLAIN-output doesn't match count(*) References: <200504141838.14705.andreak@officenet.no> In-Reply-To: <200504141838.14705.andreak@officenet.no> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.059 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200504/201 X-Sequence-Number: 21094 Andreas Joseph Krogh wrote: > Hi everybody, I have table which inly has 298 rows in it, but EXPLAIN ANALYZE > shows that PG thinks it has as much as 160057 rows AFAICT from the > EXPLAIN-output. > > I've just run a "VACUUM FULL VERBOSE" on the whole database, which gave the > following output on the relevant table(onp_web_index): > > INFO: vacuuming "public.onp_web_index" > INFO: "onp_web_index": found 0 removable, 160057 nonremovable row versions in > 206940 pages > DETAIL: 159759 dead row versions cannot be removed yet. A long-lived transaction can still see these row versions, so vacuum can't delete them. Until that transaction is committed/rolled back PG has to keep the old versions of those rows available, because it might be able to see them. So - do you have an application/client that has had a single transaction open for a long time. A very long time unless you update this table a lot. -- Richard Huxton Archonet Ltd