pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew Sullivan <ajs@crankycanuck.ca>
To: pgsql-sql@postgresql.org
Subject: Re: row-attribute in EXPLAIN-output doesn't match count(*)
Date: Thu, 14 Apr 2005 13:10:12 -0400
Message-ID: <20050414171012.GA9027@phlogiston.dyndns.org> (raw)
In-Reply-To: <200504141838.14705.andreak@officenet.no>
References: <200504141838.14705.andreak@officenet.no>

On Thu, Apr 14, 2005 at 06:38:14PM +0200, 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.

It does have 160057 rows:

> 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.
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

You no doubt have a long-running transaction keeping the rows from
being recovered.  Look for "idle in transaction" as a first guess.

> DETAIL:  160057 index row versions were removed.
> 0 index pages have been deleted, 0 are currently reusable.
> CPU 2.40s/0.92u sec elapsed 286.41 sec.
> 
> Here it says that it removed 160057 rows, doesn't it? 

No; that's the index row versions.

> Is this normal, shall I just overlook the "rows=160057" output from EXPLAIN, 
> or is something wrong?
> What does the line "DETAIL:  159759 dead row versions cannot be removed yet." 
> mean?

It means that those rows were marked invalidated after some existing
transaction started.  

A

-- 
Andrew Sullivan  | ajs@crankycanuck.ca
The plural of anecdote is not data.
		--Roger Brinner



view thread (24+ messages)  latest in thread

Message-ID: <20050414171012.GA9027@phlogiston.dyndns.org>
Permalink:  ../20050414171012.GA9027@phlogiston.dyndns.org/
Also on:    postgresql.org/message-id/20050414171012.GA9027@phlogiston.dyndns.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: ajs@crankycanuck.ca
  Subject: Re: row-attribute in EXPLAIN-output doesn't match count(*)
  In-Reply-To: <20050414171012.GA9027@phlogiston.dyndns.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox