pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Joe Miller <joe.d.miller@gmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Auto ANALYZE criteria
Date: Mon, 20 Sep 2010 22:12:31 -0400
Message-ID: <21216.1285035151@sss.pgh.pa.us> (raw)
In-Reply-To: <AANLkTi=W02Lcn63qqxoP9jjQ0CJ8wZfCJkKV7fry7CP=@mail.gmail.com>
References: <AANLkTi=W02Lcn63qqxoP9jjQ0CJ8wZfCJkKV7fry7CP=@mail.gmail.com>

Joe Miller <joe.d.miller@gmail.com> writes:
> The autovacuum daemon currently uses the number of inserted and
> updated tuples to determine if it should run VACUUM ANALYZE on a
> table.  Why doesn’t it consider deleted tuples as well?

I think you misread the code.

Now there *is* a problem, pre-9.0, if your update pattern is such that
most or all updates are HOT updates.  To quote from the 9.0 alpha
release notes:

         Revise pgstat's tracking of tuple changes to
         improve the reliability of decisions about when to
         auto-analyze.  The previous code depended on n_live_tuples +
         n_dead_tuples - last_anl_tuples, where all three of these
         numbers could be bad estimates from ANALYZE itself.  Even
         worse, in the presence of a steady flow of HOT updates and
         matching HOT-tuple reclamations, auto-analyze might never
         trigger at all, even if all three numbers are exactly right,
         because n_dead_tuples could hold steady.

It's not clear to me if that matches your problem, though.

			regards, tom lane



view thread (8+ messages)  latest in thread

Message-ID: <21216.1285035151@sss.pgh.pa.us>
Permalink:  ../21216.1285035151@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/21216.1285035151@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 using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, joe.d.miller@gmail.com
  Subject: Re: Auto ANALYZE criteria
  In-Reply-To: <21216.1285035151@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