Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 23156B5DBD9 for ; Tue, 4 Oct 2011 00:53:19 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 92153-03 for ; Tue, 4 Oct 2011 03:53:12 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id A1E46B5DBD0 for ; Tue, 4 Oct 2011 00:53:12 -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 p943rBNS027811; Mon, 3 Oct 2011 23:53:11 -0400 (EDT) To: Kevin Ricords cc: pgsql-admin@postgresql.org Subject: Re: index bloat on partial index 8.4 In-reply-to: <4E89FB03.8010407@silverback.com> References: <4E89FB03.8010407@silverback.com> Comments: In-reply-to Kevin Ricords message dated "Mon, 03 Oct 2011 14:12:19 -0400" Date: Mon, 03 Oct 2011 23:53:11 -0400 Message-ID: <27810.1317700391@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.404 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RP_MATCHES_RCVD=-0.504 X-Spam-Level: X-Archive-Number: 201110/13 X-Sequence-Number: 38465 Kevin Ricords writes: > My implementation is a 150 million row table with a partial index on > newly created rows, where every row will be updated to not match the > index condition every few minutes. > The index size appears to grow proportional to the number of rows added > to the table, but doesn't shrink when rows are updated to no longer meet > the partial index condition. Well, a btree index is basically never going to shrink, short of a rebuild (REINDEX). The right administrative goal is to prevent it from growing. The key issues you need to deal with are (1) making sure it gets vacuumed often enough; (2) making sure there are not long-lived transactions that prevent VACUUM from removing recently-dead tuples. You've not really provided enough data for anyone to guess whether the problem is (1) or (2) or both. What's the vacuuming configuration on your installation? Have you checked for applications failing to close their transactions? regards, tom lane