Skip site navigation (1) Skip section navigation (2)

Re: Measuring relation free space

From: Noah Misch <noah(at)leadboat(dot)com>
To: Jaime Casanova <jaime(at)2ndquadrant(dot)com>
Cc: Bernd Helmle <mailings(at)oopsware(dot)de>, Greg Smith <greg(at)2ndquadrant(dot)com>,pgsql-hackers(at)postgresql(dot)org
Subject: Re: Measuring relation free space
Date: 2012-01-16 10:09:31
Message-ID: (view raw, whole thread or download thread mbox)
Lists: 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(at)leadboat(dot)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.

In response to


pgsql-hackers by date

Next:From: Fujii MasaoDate: 2012-01-16 12:45:23
Subject: Re: New replication mode: write
Previous:From: Greg SmithDate: 2012-01-16 09:57:46
Subject: CommitFest 2012-01 kick-off

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group