On Sat, Jan 14, 2012 at 02:40:46PM -0500, Jaime Casanova wrote:
> On Sat, Jan 14, 2012 at 6:26 AM, Noah Misch <noah@leadboat.com> wrote:
> >
> > - pgstattuple() and relation_free_space() should emit the same number, even if
> > ?that means improving pgstattuple() at the same time.
>
> yes, i just wanted to understand which one was more accurate and
> why... and give the opportunity for anyone to point my error if any
pgstattuple()'s decision to treat half-dead pages like deleted pages is
better. That transient state can only end in the page's deletion.
I don't know about counting non-leaf pages, but I personally wouldn't revisit
pgstattuple()'s decision there. In the indexes I've briefly surveyed, the
ratio of leaf pages to non-leaf pages is 100:1 or better. No amount of bloat
in that 1% will matter. Feel free to make the argument if you think
otherwise, though; I've only taken a brief look at the topic.
> > - relation_free_space() belongs in the pgstattuple extension, because its role
> > ?is cheaper access to a single pgstattuple() metric.
>
> oh! right! so, what about just fixing the free_percent that
> pgstattuple is providing
If pgstattuple() meets your needs, you might indeed no longer need any patch.