Re: autovacuum not prioritising for-wraparound tables

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: autovacuum not prioritising for-wraparound tables
Дата
Msg-id 20130125152915.GD5584@alvh.no-ip.org
обсуждение исходный текст
Ответ на Re: autovacuum not prioritising for-wraparound tables  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: autovacuum not prioritising for-wraparound tables  (Peter Eisentraut <peter_e@gmx.net>)
Re: autovacuum not prioritising for-wraparound tables  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Tom Lane escribió:

> As posted, what we've got here is sorting on a boolean condition, with
> the behavior within each group totally up to the whims of qsort().  That
> seems especially dangerous since the priority order is mostly undefined.
>
> I was a bit surprised that Alvaro didn't propose sorting by the age of
> relfrozenxid, at least for the subset of tables that are considered
> wraparound hazards.  Not sure what a good criterion is for the rest.

Hah.  This patch began life with more complex prioritisation at first,
but before going much further I dumbed down the idea to avoid having to
discuss these issues, as it doesn't seem a particularly good timing.
And I do want to get something back-patchable.

So if we're to discuss this, here's what I had in mind:

1. for-wraparound tables always go first; oldest age(relfrozenxid) are
sorted earlier.  For tables of the same age, consider size as below.

2. for other tables, consider floor(log(size)).  This makes tables of
sizes in the same ballpark be considered together.

3. For tables of similar size, consider
(n_dead_tuples - threshold) / threshold.
"threshold" is what gets calculated as the number of tuples over which
a table is considered for vacuuming.  This number, then, is a relative
measure of how hard is vacuuming needed.

--
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services



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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: Hanging backends and possible index corruption
Следующее
От: Kohei KaiGai
Дата:
Сообщение: Re: [sepgsql 1/3] add name qualified creation label