Re: fix pg_autovacuum - Mailing list pgsql-general

From Alvaro Herrera
Subject Re: fix pg_autovacuum
Date
Msg-id 20050729220514.GF16537@alvh.no-ip.org
Whole thread Raw
Responses Re: fix pg_autovacuum
List pgsql-general
On Fri, Jul 29, 2005 at 03:54:07PM -0500, Jeff Lund wrote:

Hi,

In the future please post to a list instead of asking me privately.  I
have picked a list arbitrarily to post the response.

>   I am a DBA using Postgres 8.0.3, and it is great.  Could someone
> tell me what is wrong or what the problems are with fix pg_autovacuum
> O(n^2) behavior.

The problem is that pg_autovacuum uses a query against the pg_class
system catalog, and has to compare the results with its internal table
list.  This was done using a O(n^2) algorithm.  I'm not sure if a fix
was developed for this problem, but I suspect not.

The integrated autovacuum process that has been developed for 8.1 does
not have this problem because it uses a radically different approach to
obtaining/keeping information.  In fact, each iteration is a new
process, so there's no table list kept in memory.

I might add that I completely rewrote the autovacuum daemon, and I don't
think a single line of the original code is present in the new version.
The ideas, of course, are mostly the same.  (For the time being at least
-- there's no saying where the new code will evolve to.)

--
Alvaro Herrera (<alvherre[a]alvh.no-ip.org>)
"Las mujeres son como hondas:  mientras más resistencia tienen,
 más lejos puedes llegar con ellas"  (Jonas Nightingale, Leap of Faith)

pgsql-general by date:

Previous
From: Phil Endecott
Date:
Subject: Re: Megabytes of stats saved after every connection
Next
From: Bruno Wolff III
Date:
Subject: Re: Looking for version 7.4.7 for windows