Re: autovacuum_work_mem - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: autovacuum_work_mem
Date
Msg-id 20131213184006.GE12902@eldon.alvh.no-ip.org
Whole thread Raw
In response to Re: autovacuum_work_mem  (Heikki Linnakangas <hlinnakangas@vmware.com>)
Responses Re: autovacuum_work_mem
List pgsql-hackers
Heikki Linnakangas escribió:

> I haven't been following this thread in detail, but would it help if
> we implemented a scheme to reduce (auto)vacuum's memory usage? Such
> schemes have been discussed in the past, packing the list of dead
> items more tightly.

Well, it would help some, but it wouldn't eliminate the problem
completely.  Autovacuum scales its memory usage based on the size of the
table.  There will always be a table so gigantic that a maximum
allocated memory is to be expected; and DBAs will need a way to limit
the memory consumption even if we pack dead items more densely.

I was playing with keeping item pointers for each page in a bitmapset.
This was pretty neat and used a lot less memory than currently, except
that I needed to allocate a large chunk of memory and then have
bitmapsets use words within that large allocation space.  It turned out
to be too ugly so I abandoned it.  With the "varbit encoding" thingy in
the recent GIN patchset, maybe it would be workable.

I think a more dense packing is desired regardless of this patch.
Maybe we can have a generic module for "item pointer arrays" which could
be useful for both autovacuum and GIN.

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: "stuck spinlock"
Next
From: Stephen Frost
Date:
Subject: Re: Extension Templates S03E11