Tom Lane wrote:
> Alvaro Herrera <alvherre@commandprompt.com> writes:
> > Right now we just plow
> > ahead using a pg_class seqscan, which avoids locking the relations
> > just for the sake of verifying whether they need work.
>
> We should stick with that, and refactor the reloptions code as needed to
> be able to work from just a pg_class tuple. I'm envisioning a scheme
> like:
>
> bottom level: extract from pg_class tuple, return a palloc'd struct
>
> relcache: logic to cache the result of the above
>
> top level: exported function to return a cached options struct
>
> The autovac scan could use the bottom-level API.
I'm not sure that we have any use for the top level you propose; the
attached patch just uses the two lower levels, and I think it fits
autovacuum usage just fine. Thanks for the idea.
--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support