Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 6A332B5DC0C for ; Tue, 4 Oct 2011 15:28:05 -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 53388-08 for ; Tue, 4 Oct 2011 18:27:59 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from exsmtp.infoquest.com (exsmtp1.infoquest.com [65.61.37.201]) by mail.postgresql.org (Postfix) with ESMTP id 0BA94B5DBEE for ; Tue, 4 Oct 2011 15:27:58 -0300 (ADT) Received: from [10.5.1.245] (208.111.250.195) by exsmtp.infoquest.com (65.61.37.200) with Microsoft SMTP Server (TLS) id 8.3.192.1; Tue, 4 Oct 2011 14:27:57 -0400 Message-ID: <4E8B5030.7090902@silverback.com> Date: Tue, 4 Oct 2011 14:28:00 -0400 From: Kevin Ricords User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1 MIME-Version: 1.0 To: Tom Lane CC: "pgsql-admin@postgresql.org" Subject: Re: index bloat on partial index 8.4 References: <4E89FB03.8010407@silverback.com> <27810.1317700391@sss.pgh.pa.us> In-Reply-To: <27810.1317700391@sss.pgh.pa.us> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201110/15 X-Sequence-Number: 38467 Thank you for your response. I believe I misunderstood "reclaimed for re-use". Using contrib/pg_freespace, I see empty index pages can be reused elsewhere in the same index, but are not deallocated. To keep my index at the size I expected, I will have to vacuum more frequently or reindex/rebuild regularly. -Kevin On 10/3/2011 11:53 PM, Tom Lane wrote: > 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 > . >