Re: auto-vacuum & Negative "anl" Values

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Dylan Hansen <dhansen(at)pixpo(dot)com>
Cc: pgsql-general(at)postgresql(dot)org, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, "Matthew T(dot) O'Connor" <matthew(at)zeut(dot)net>
Subject: Re: auto-vacuum & Negative "anl" Values
Date: 2006-06-22 18:40:13
Message-ID: 2266.1151001613@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Dylan Hansen <dhansen(at)pixpo(dot)com> writes:
> I have been spending some time looking into how auto-vacuum is
> performing on one of our servers. After putting the PostgreSQL logs
> in debug I noticed that the threshold for ANALYZE was never being hit
> for a particular table because the calculated value becomes
> increasingly negative.

Hmm, it shouldn't ever be negative at all, I would think. The
calculation in question is

anltuples = tabentry->n_live_tuples + tabentry->n_dead_tuples -
tabentry->last_anl_tuples;

Apparently somehow last_anl_tuples has managed to get to be bigger than
n_live_tuples, which maybe could happen after a delete. Should we be
clamping last_anl_tuples to not exceed n_live_tuples somewhere?
Alvaro and Matthew, what do you think?

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Andrew Gould 2006-06-22 18:52:03 OT: publicly available databases?
Previous Message Todd A. Cook 2006-06-22 18:34:46 Re: Out of memory error in 8.1.0 Win32