Re: autovacuum, reloptions, and hardcoded pg_class tupdesc - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: autovacuum, reloptions, and hardcoded pg_class tupdesc
Date
Msg-id 20090122234758.GP4296@alvh.no-ip.org
Whole thread Raw
In response to Re: autovacuum, reloptions, and hardcoded pg_class tupdesc  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: autovacuum, reloptions, and hardcoded pg_class tupdesc  (Alvaro Herrera <alvherre@commandprompt.com>)
List pgsql-hackers
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

Attachment

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Pluggable Indexes
Next
From: Josh Berkus
Date:
Subject: Re: Pluggable Indexes (was Re: rmgr hooks (v2))