Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 3079A9FB684 for ; Fri, 16 Mar 2007 11:29:17 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-new, port 10024) with ESMTP id 88899-03 for ; Fri, 16 Mar 2007 11:29:06 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id D99799FB659 for ; Fri, 16 Mar 2007 11:29:12 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id l2GET9BJ006305; Fri, 16 Mar 2007 10:29:11 -0400 (EDT) To: aromanchuk@swsoft.com cc: pgsql-performance@postgresql.org Subject: Re: Determine dead tuples size In-reply-to: <17410023575.20070316114150@swsoft.com> References: <24499713.20070315135847@swsoft.com> <20070315114508.GA12266@winnie.fuhr.org> <17410023575.20070316114150@swsoft.com> Comments: In-reply-to Alexey Romanchuk message dated "Fri, 16 Mar 2007 11:41:50 +0600" Date: Fri, 16 Mar 2007 10:29:09 -0400 Message-ID: <6304.1174055349@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200703/257 X-Sequence-Number: 23662 Alexey Romanchuk 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