Matthew T. O'Connor wrote:
> > - using some of the ideas from contrib/pgstattuple (i.e. looking at the
> > amount of "dead space" in the relation) could be an interesting
> > enhancement.
>
> I did a little looking at this a while ago, it wasn't clear to me that
> pgstattuple was any faster than just doing a vacuum.
Someone reported that pg_stattuple is faster than COUNT(*), so it might
be faster than VACUUM. Actually, it is a loadable function, so it has
direct access to the backend area, while libpq does not. It might also
be interesting to create a function that can return the free space map
size for a relation. That would allow you to know when there is little
free space available for a table getting a lot of inserts.
Of course, I am just throwing out ideas, and they may not be good ones. :-)
--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073