Re: BUG #17717: Regression in vacuumdb (15 is slower than 10/11 and possible memory issue)

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #17717: Regression in vacuumdb (15 is slower than 10/11 and possible memory issue)
Дата
Msg-id 3544447.1671141436@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: BUG #17717: Regression in vacuumdb (15 is slower than 10/11 and possible memory issue)  (Peter Geoghegan <pg@bowt.ie>)
Ответы Re: BUG #17717: Regression in vacuumdb (15 is slower than 10/11 and possible memory issue)
Список pgsql-bugs
Peter Geoghegan <pg@bowt.ie> writes:
> On Thu, Dec 15, 2022 at 10:56 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> * A better idea, though sadly not very back-patchable, could
>> be to expose a VACUUM option to control whether it runs
>> vac_update_datfrozenxid, so that vacuumdb can do that just
>> once at the end.  Considering that vac_update_datfrozenxid
>> requires an exclusive lock, the current behavior is poison for
>> parallel vacuuming quite aside from the O(N^2) issue.  This
>> might tie into some work Peter G. has been pursuing, too.

> That sounds like a good idea to me. But do we actually need a VACUUM
> option for this? I wonder if we could get away with having the VACUUM
> command never call vac_update_datfrozenxid(), except when run in
> single-user mode. It would be nice to make pg_xact/clog truncation
> autovacuum's responsibility.

I could get behind manual VACUUM not invoking vac_update_datfrozenxid
by default, perhaps.  But if it can never call it, then that is a
fairly important bit of housekeeping that is unreachable except by
autovacuum.  No doubt the people who turn off autovacuum are benighted,
but they're still out there.

Could we get somewhere by saying that manual VACUUM calls
vac_update_datfrozenxid only if it's a full-DB vacuum (ie, no table
was specified)?  That would fix the problem at hand.  However, it'd
mean (since v12) that a vacuumdb run never calls vac_update_datfrozenxid
at all, which would result in horrible problems for any poor sods
who think that a cronjob running "vacuumdb -a" is an adequate substitute
for autovacuum.

Or maybe we could modify things so that "autovacuum = off" doesn't prevent
occasional cycles of vac_update_datfrozenxid-and-nothing-else?

In the end I feel like a manual way to call vac_update_datfrozenxid
would be the least magical way of running this.

            regards, tom lane



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

Предыдущее
От: Jean-Francois Levesque
Дата:
Сообщение: Re: BUG #17710: Slow queries (100% CPU) after auto-vacuum
Следующее
От: Kyotaro Horiguchi
Дата:
Сообщение: Re: pg_rewind succeed but postgresql showing error when trying to make standby with common ancestor