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