pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jeff Boes <jboes@nexcerpt.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-admin@postgresql.org
Subject: Re: pg_class.reltuples not reset by VACUUM?
Date: 08 Apr 2003 15:19:32 -0400
Message-ID: <1049829572.4868.39.camel@takin.private.nexcerpt.com> (raw)
In-Reply-To: <19299.1049829035@sss.pgh.pa.us>
References: <b6v1p3$cp4$1@news.hub.org>
	<15397.1049824333@sss.pgh.pa.us>
	<1049825429.4871.36.camel@takin.private.nexcerpt.com>
	<19299.1049829035@sss.pgh.pa.us>

On Tue, 2003-04-08 at 15:10, Tom Lane wrote:

> Yup, you definitely have a big problem with dead-but-unreclaimed tuples.
> Look for some client that's holding an open transaction for long
> periods.

It's even weirder than that:  note in the following how VACUUM sets the
tuple count high, and ANALYZE sets it low.  This appears to happen even
if there are no transactions open.

# explain select count(*) from job_queue;
NOTICE:  QUERY PLAN:

Aggregate  (cost=7064.26..7064.26 rows=1 width=0)
  ->  Seq Scan on job_queue  (cost=0.00..7056.81 rows=2981 width=0)

EXPLAIN
# vacuum job_queue;
VACUUM

# explain select count(*) from job_queue;
NOTICE:  QUERY PLAN:

Aggregate  (cost=11690.88..11690.88 rows=1 width=0)
  ->  Seq Scan on job_queue  (cost=0.00..10764.70 rows=370470 width=0)

EXPLAIN

# analyze job_queue;
ANALYZE

# explain select count(*) from job_queue;
NOTICE:  QUERY PLAN:

Aggregate  (cost=7097.34..7097.34 rows=1 width=0)
  ->  Seq Scan on job_queue  (cost=0.00..7089.87 rows=2987 width=0)

EXPLAIN


-- 
Jeff Boes                                      vox 269.226.9550 ext 24
Database Engineer                                     fax 269.349.9076
Nexcerpt, Inc.                                 http://www.nexcerpt.com
           ...Nexcerpt... Extend your Expertise




view thread (11+ messages)  latest in thread

Message-ID: <1049829572.4868.39.camel@takin.private.nexcerpt.com>
Permalink:  ../1049829572.4868.39.camel@takin.private.nexcerpt.com/
Also on:    postgresql.org/message-id/1049829572.4868.39.camel@takin.private.nexcerpt.com

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: jboes@nexcerpt.com, tgl@sss.pgh.pa.us
  Subject: Re: pg_class.reltuples not reset by VACUUM?
  In-Reply-To: <1049829572.4868.39.camel@takin.private.nexcerpt.com>
  References: <b6v1p3$cp4$1@news.hub.org> <15397.1049824333@sss.pgh.pa.us> <1049825429.4871.36.camel@takin.private.nexcerpt.com> <19299.1049829035@sss.pgh.pa.us> <1049829572.4868.39.camel@takin.private.nexcerpt.com>

* 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