Re: Vacuum not cleaning up rows.

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Vacuum not cleaning up rows.
Дата
Msg-id 31037.1560988222@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Vacuum not cleaning up rows.  ("S. Bob" <sbob@quadratum-braccas.com>)
Ответы Re: Vacuum not cleaning up rows.
Список pgsql-admin
"S. Bob" <sbob@quadratum-braccas.com> writes:
> we have a table that consistently has 2x the number of dead rows than 
> live rows.
> I've done some digging and it looks like somehow the application is 
> holding shared locks that force vacuum to not cleanup rows.

This is not a locking issue; if it were, vacuum would be unable to
scan the table at all.

What it is is a snapshot issue: that is, some transaction has a snapshot
that's old enough to allow it to see those dead rows if it were to look.
So vacuum can't remove the rows for fear of causing transactional
consistency failures.

What you want to do is look into pg_stat_activity for transactions with
very old start times, and then cancel them or otherwise force them to
terminate.  Also, if there are no obvious candidates there, you might
be having a problem with prepared transactions --- look into
pg_prepared_xacts to see if there are any old ones of those.

            regards, tom lane



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

Предыдущее
От: "S. Bob"
Дата:
Сообщение: Vacuum not cleaning up rows.
Следующее
От: Rui DeSousa
Дата:
Сообщение: Re: zero data loss recovery is possbile with pgbackrest tool?