pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Jeff Boes <jboes@nexcerpt.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: Sidetracking pg_autovacuum
Date: Wed, 18 May 2005 15:40:55 -0400
Message-ID: <24304.1116445255@sss.pgh.pa.us> (raw)
In-Reply-To: <428B8A27.7050402@nexcerpt.com>
References: <428B8A27.7050402@nexcerpt.com>

Jeff Boes <jboes@nexcerpt.com> writes:
> What would cause an otherwise well-behaved table to start doing this? Is
> this just a "dead spot" in the ANALYZE command? (By which I mean:
> ANALYZE randomly sampling rows, but my data is not terribly random, so
> it gets fooled?)

7.4's ANALYZE is indeed easily fooled by nonuniform tuple density.
8.0 uses a different sampling algorithm that we hope will do better.

> [And here's the remaining question in my puzzled mind: ANALYZE would not 
> change the reltuples value, but VACUUM FULL ANALYZE did. Er-wha?]

Any variant of VACUUM records the exact number of tuples that it found
in its full table scan in reltuples.  It's only a standalone ANALYZE
that has to approximate.

The case where you saw reltuples > count(*) probably came from the fact
that VACUUM counts physical tuples --- that is, the difference reflects
dead-but-not-yet-removable tuples.

			regards, tom lane



view thread (3+ messages)  latest in thread

Message-ID: <24304.1116445255@sss.pgh.pa.us>
Permalink:  ../24304.1116445255@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/24304.1116445255@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, jboes@nexcerpt.com
  Subject: Re: Sidetracking pg_autovacuum
  In-Reply-To: <24304.1116445255@sss.pgh.pa.us>
  References: <428B8A27.7050402@nexcerpt.com> <24304.1116445255@sss.pgh.pa.us>

* 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