Re: a fast bloat measurement tool (was Re: Measuring relation free space) - Mailing list pgsql-hackers

From Robert Haas
Subject Re: a fast bloat measurement tool (was Re: Measuring relation free space)
Date
Msg-id CA+TgmoYggGeyH5OpiJMfK8Ggx6Ettwg7s3g_Wxf1fz3KnwnOig@mail.gmail.com
Whole thread Raw
In response to a fast bloat measurement tool (was Re: Measuring relation free space)  (Abhijit Menon-Sen <ams@2ndQuadrant.com>)
Responses Re: a fast bloat measurement tool  (Abhijit Menon-Sen <ams@2ndquadrant.com>)
List pgsql-hackers
On Wed, Apr 2, 2014 at 5:41 PM, Abhijit Menon-Sen <ams@2ndquadrant.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



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: jsonb is also breaking the rule against nameless unions
Next
From: Robert Haas
Date:
Subject: Re: Fwd: SSL auth question