Re: Measuring relation free space - Mailing list pgsql-hackers

From Noah Misch
Subject Re: Measuring relation free space
Date
Msg-id 20120116100931.GA29684@tornado.leadboat.com
Whole thread Raw
In response to Re: Measuring relation free space  (Jaime Casanova <jaime@2ndquadrant.com>)
Responses Re: Measuring relation free space  (Jaime Casanova <jaime@2ndquadrant.com>)
List pgsql-hackers
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.


pgsql-hackers by date:

Previous
From: Greg Smith
Date:
Subject: CommitFest 2012-01 kick-off
Next
From: Fujii Masao
Date:
Subject: Re: New replication mode: write