Re: auto-vacuum & Negative "anl" Values

Поиск
Список
Период
Сортировка
От Matthew T. O'Connor
Тема Re: auto-vacuum & Negative "anl" Values
Дата
Msg-id 449DC63D.6060805@zeut.net
обсуждение исходный текст
Ответ на Re: auto-vacuum & Negative "anl" Values  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: auto-vacuum & Negative "anl" Values  (Dylan Hansen <dhansen@pixpo.com>)
Список pgsql-general
Tom Lane wrote:
> Dylan Hansen <dhansen@pixpo.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?

I think I had something in the contrib version that checked this.  I
always assumed it would be caused by a stats reset which was more common
in earlier PGSQL releases since stats_reset_on_startup (or whatever the
correct spelling of that is) was enabled by default.



В списке pgsql-general по дате отправления:

Предыдущее
От: Jan Wieck
Дата:
Сообщение: Re: Adding foreign key constraints without integrity check?
Следующее
От: Mark Gibson
Дата:
Сообщение: casting... adding integer to timestamp