Re: a fast bloat measurement tool (was Re: Measuring relation free space)

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Abhijit Menon-Sen <ams(at)2ndquadrant(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: a fast bloat measurement tool (was Re: Measuring relation free space)
Date: 2014-04-03 00:10:54
Message-ID: CA+TgmoYggGeyH5OpiJMfK8Ggx6Ettwg7s3g_Wxf1fz3KnwnOig@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Apr 2, 2014 at 5:41 PM, Abhijit Menon-Sen <ams(at)2ndquadrant(dot)com> wrote:
> I've attached an extension that produces largely pgstattuple-compatible
> numbers for a table without doing a full-table scan.
>
> It scans through the table, skipping blocks that have their visibility
> map bit set. For such pages, it gets the free space from the free space
> map, and assumes that all remaining space on the page is taken by live
> tuples. It scans other pages tuple-by-tuple and counts live and dead
> tuples and free space.

That's clever. I think it might underestimate free space relative to
tuples because the free space map isn't guaranteed to be completely
correct. But I guess you knew that already...

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2014-04-03 00:12:36 Re: Fwd: SSL auth question
Previous Message Andres Freund 2014-04-02 21:50:19 Re: jsonb is also breaking the rule against nameless unions