Re: new vacuum is slower for small tables - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: new vacuum is slower for small tables
Date
Msg-id 20081208150151.GA4517@alvh.no-ip.org
Whole thread Raw
In response to Re: new vacuum is slower for small tables  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Responses Re: new vacuum is slower for small tables
List 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 by date:

Previous
From: "Robert Haas"
Date:
Subject: Re: ALTER composite type does not work, but ALTER TABLE which ROWTYPE is used as a type - works fine
Next
From: Tom Lane
Date:
Subject: Re: new vacuum is slower for small tables