Re: [PATCHES] pg_freespacemap question - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [PATCHES] pg_freespacemap question
Date
Msg-id 11738.1142210591@sss.pgh.pa.us
Whole thread Raw
In response to Re: [PATCHES] pg_freespacemap question  (Mark Kirkwood <markir@paradise.net.nz>)
Responses Re: [PATCHES] pg_freespacemap question
Re: [PATCHES] pg_freespacemap question
List pgsql-hackers
> Tatsuo Ishii wrote:
>> BTW, I noticed difference of outputs from pg_freespacemap and
>> pgstattuple.
>>
>> I ran pgbench and inspected "accounts" table by using these tools.
>>
>> pg_freespacemap:
>> sum of bytes: 250712
>>
>> pgstattuple:
>> free_space: 354880
>>
>> Shouldn't they be identical?

No, because (a) pgbench vacuums at the start of the run not the end,
and (b) vacuum/fsm disregard pages with "uselessly small" amounts of
free space (less than the average tuple size, IIRC).

I do notice a rather serious shortcoming of pg_freespacemap in its
current incarnation, which is that it *only* shows you the per-page free
space data, and not any of the information that would let you determine
what the FSM is doing to filter the raw data.  The per-relation
avgRequest and lastPageCount fields would be interesting for instance.
Perhaps there should be a second view with one row per relation to
carry the appropriate data.

            regards, tom lane

pgsql-hackers by date:

Previous
From: Mark Kirkwood
Date:
Subject: Re: [PATCHES] pg_freespacemap question
Next
From: Mark Kirkwood
Date:
Subject: Re: [PATCHES] pg_freespacemap question