Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 6F236B62B21 for ; Fri, 3 Jun 2011 14:39:20 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 17659-01 for ; Fri, 3 Jun 2011 17:39:13 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 5A5BEB62B1A for ; Fri, 3 Jun 2011 14:39:13 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id p53HdCFR001740; Fri, 3 Jun 2011 13:39:12 -0400 (EDT) To: Mark Stosberg cc: pgsql-admin@postgresql.org Subject: Re: surprised to find bloat in insert-only table In-reply-to: References: <28332.1307116922@sss.pgh.pa.us> Comments: In-reply-to Mark Stosberg message dated "Fri, 03 Jun 2011 13:03:31 -0400" Date: Fri, 03 Jun 2011 13:39:12 -0400 Message-ID: <1739.1307122752@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201106/19 X-Sequence-Number: 37645 Mark Stosberg writes: > Compared to 1669 MB reported as table bloat in the 'bloat' view. So, > the bloat is about 40% of the total size. > For an index, it's 410 MB of bloat, vs 1669 MB for an index size. Hm ... 40% unused space wouldn't be surprising at all for an index. The traditional rule of thumb for a b-tree index is that the steady state fill factor is about 2/3rds. You can do better for an index that is loaded in increasing order (eg, an index on a serial or timestamp column typically has a higher fill factor) but indexes on columns that are more random are not going to see that. > One thing that looks suspicious is that the exact same number of bytes > is being report for the table as well as each index. Um. In that case I'd say your view is flat out wrong... regards, tom lane