Re: Determine dead tuples size

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: aromanchuk(at)swsoft(dot)com
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Determine dead tuples size
Date: 2007-03-16 14:29:09
Message-ID: 6304.1174055349@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Alexey Romanchuk <aromanchuk(at)swsoft(dot)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

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message cedric 2007-03-16 15:38:37 unsubscribe
Previous Message Joshua D. Drake 2007-03-16 14:00:47 Re: Postgres batch write very slow - what to do