Re: autovacuum and TOAST tables - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: autovacuum and TOAST tables
Date
Msg-id 20080808222639.GD3800@alvh.no-ip.org
Whole thread Raw
In response to Re: autovacuum and TOAST tables  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: autovacuum and TOAST tables  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane wrote:
> Alvaro Herrera <alvherre@commandprompt.com> writes:
> > There's two things I'm not happy about in this patch:
>
> > 1. it uses a List to keep the mapping of heap<->toast Oids.  This is
> > needed to be able to fetch the main rel's pg_autovacuum entry to process
> > the toast table.  This incurs in O(n^2) behavior.
>
> Use a dynahash table instead?

Right, the attached patch does that.

Note that this patch allows a toast table to be vacuumed by the user:

alvherre=# vacuum pg_toast.pg_toast_39970;
VACUUM

I don't have a problem with that, but if anyone thinks this is not a
good idea, please speak up.

--
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

Attachment

pgsql-hackers by date:

Previous
From: "Kevin Grittner"
Date:
Subject: Re: IN vs EXISTS equivalence
Next
From: Tom Lane
Date:
Subject: Re: autovacuum and TOAST tables