Re: Determine dead tuples size - Mailing list pgsql-performance

From Tom Lane
Subject Re: Determine dead tuples size
Date
Msg-id 6304.1174055349@sss.pgh.pa.us
Whole thread Raw
In response to Re: Determine dead tuples size  (Alexey Romanchuk <aromanchuk@swsoft.com>)
List pgsql-performance
Alexey Romanchuk <aromanchuk@swsoft.com> writes:
> When i try to sum all size (live, dead and free) the sum is not equal
> total size. For this table 206555428 + 3380295 + 13896816 = 223832539.
> The difference between total and sum is 9410085. It is near 5%.

pgstattuple is a bit simplistic: it doesn't count the page headers or
item pointers at all.  It looks to me like it also fails to consider
the effects of alignment padding --- if a tuple's length is shown as
63, that's what it counts, even though the effective length is 64.
(This might not be a problem in practice --- I'm not sure if the stored
t_len has always been maxaligned or not.)

            regards, tom lane

pgsql-performance by date:

Previous
From: "Joshua D. Drake"
Date:
Subject: Re: Postgres batch write very slow - what to do
Next
From: cedric
Date:
Subject: unsubscribe