Re: Autovacuum in the backend

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Autovacuum in the backend
Дата
Msg-id 16313.1118936521@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Autovacuum in the backend  (Alvaro Herrera <alvherre@surnet.cl>)
Ответы Re: Autovacuum in the backend  ("Matthew T. O'Connor" <matthew@zeut.net>)
Re: Autovacuum in the backend  (Hannu Krosing <hannu@skype.net>)
Список pgsql-hackers
Alvaro Herrera <alvherre@surnet.cl> writes:
> Now, I'm hearing people don't like using libpq.

Yeah --- a libpq-based solution is not what I think of as integrated at
all, because it cannot do anything that couldn't be done by the existing
external autovacuum process.  About all you can buy there is having the
postmaster spawn the autovacuum process, which is slightly more
convenient to use but doesn't buy any real new functionality.

> Some people say "keep it simple and have one process per cluster."  I
> think they don't realize it's actually more complex, not the other way
> around.

Agreed.  If you aren't connected to a specific database, then you cannot
use any of the normal backend infrastructure for catalog access, which
is pretty much a killer limitation.

A simple approach would be a persistent autovac background process for
each database, but I don't think that's likely to be acceptable because
of the amount of resources tied up (PGPROC slots, open files, etc).

One thing that might work is to have the postmaster spawn an autovac
process every so often.  The first thing the autovac child does is pick
up the current statistics dump file (which it can find without being
connected to any particular database).  It looks through that to
determine which database is most in need of work, then connects to that
database and does some "reasonable" amount of work there, and finally
quits.  Awhile later the postmaster spawns another autovac process that
can connect to a different database and do work there.

This design would mean that the autovac process could not have any
long-term state of its own: any long-term state would have to be in
either system catalogs or the statistics.  But I don't see that as
a bad thing really --- exposing the state will be helpful from a
debugging and administrative standpoint.
        regards, tom lane


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

Предыдущее
От: Hans-Jürgen Schönig
Дата:
Сообщение: Re: Autovacuum in the backend
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [PATCHES] Escape handling in strings