autovacuum and TOAST tables

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема autovacuum and TOAST tables
Дата
Msg-id 20080808165809.GB3800@alvh.no-ip.org
обсуждение исходный текст
Ответы Re: autovacuum and TOAST tables  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Hi,

Here's a patch to make autovacuum process TOAST tables separately from
main tables.

The most important change is that when called from autovac, vacuum does
not process the TOAST table at all.  It will only do so when the stats
for the TOAST table say that it needs vacuuming.  (A user-invoked vacuum
still processes TOAST tables normally.)

Per previous discussion, the autovac code is now doing two passes over
pg_class.

There's two things I'm not happy about in this patch:

1. it uses a List to keep the mapping of heap<->toast Oids.  This is
needed to be able to fetch the main rel's pg_autovacuum entry to process
the toast table.  This incurs in O(n^2) behavior.

2. the "expected relkind" business is gone; it's not easy to pass the
correct relkind down from autovac, and at the same time have a
reasonable thing to pass down from user-invoked vacuum.  Right now what
the patch does is check that the rel to vacuum is either
RELKIND_RELATION or _TOASTVALUE.

(I admit that my unhappiness about the second is mild, though.)

--
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

Вложения

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

Предыдущее
От: Josh Berkus
Дата:
Сообщение: Re: CommitFest July Over
Следующее
От: Josh Berkus
Дата:
Сообщение: Re: Proposal of SE-PostgreSQL patches [try#2]