Re: new vacuum is slower for small tables

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: new vacuum is slower for small tables
Дата
Msg-id 20081208150151.GA4517@alvh.no-ip.org
обсуждение исходный текст
Ответ на Re: new vacuum is slower for small tables  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Ответы Re: new vacuum is slower for small tables  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Heikki Linnakangas escribió:

> Oprofile suggests that most of the time is actually spent in  
> pgstat_vacuum_stat. And more precisely in pstat_collect_oids, which is  
> called by pgstat_vacuum_stat.

Hmm, that routine is expensive.  Calling it for every vacuum is not good
:-(  Fortunately, autovacuum calls it only once per worker run rather
than once per table.  That limits the damage.

I wonder if we could do better in pgstat_vacuum_stat; for example,
scanning all of pg_proc is useless most of the time, and then it has to
fill and seq-search a hash table with all the builtins which will never
get dropped.  I wonder if we could use pg_depend instead of pg_proc, and
skip pinned functions, for example.

In the end, it would be better if this function was not called at all
for user-invoked vacuum, and have autovacuum handle it.  However, that
doesn't work for people who disable autovacuum.

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.


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

Предыдущее
От: "Robert Haas"
Дата:
Сообщение: Re: ALTER composite type does not work, but ALTER TABLE which ROWTYPE is used as a type - works fine
Следующее
От: Tom Lane
Дата:
Сообщение: Re: new vacuum is slower for small tables