Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 5D33C9FA2E9 for ; Wed, 18 Oct 2006 19:22:16 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 75374-07 for ; Wed, 18 Oct 2006 19:22:12 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mail.refractions.net (mail.refractions.net [24.68.236.214]) by postgresql.org (Postfix) with ESMTP id 2138E9F9B3F for ; Wed, 18 Oct 2006 19:22:12 -0300 (ADT) Received: from lion.animals (lion [192.168.50.200]) by mail.refractions.net (Postfix) with ESMTP id A0571122C373 for ; Wed, 18 Oct 2006 15:31:06 -0700 (PDT) Received: by lion.animals (Postfix, from userid 88) id E7918E3DD; Wed, 18 Oct 2006 15:22:05 -0700 (PDT) Received: from refractions.net (unknown [192.168.50.43]) by lion.animals (Postfix) with ESMTP id 16AC6E3C7 for ; Wed, 18 Oct 2006 15:22:04 -0700 (PDT) Message-ID: <4536A8A3.1050409@refractions.net> Date: Wed, 18 Oct 2006 15:20:19 -0700 From: Graham Davis Reply-To: gdavis@refractions.net User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6b) Gecko/20031205 Thunderbird/0.4 X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: index growth problem References: In-Reply-To: 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=0.071 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200610/382 X-Sequence-Number: 21511 I have a question about index growth. The way I understand it, dead tuples in indexes were not reclaimed by VACUUM commands in the past. However, I've read in a few forum posts that this was changed somewhere between 7.4 and 8.0. I'm having an issue where my GIST indexes are growing quite large, and running a VACUUM doesn't appear to remove the dead tuples. For example, if I check out the size an index before running any VACUUM : select pg_relation_size('asset_positions_position_idx'); pg_relation_size ------------------ 11624448 (1 row) The size is about 11Mb. If I run a VACUUM command in verbose, I see this about the index: INFO: index "asset_positions_position_idx" now contains 4373 row versions in 68 pages DETAIL: 0 index pages have been deleted, 0 are currently reusable. CPU 0.00s/0.00u sec elapsed 0.16 sec. When I run the same command to find the size after the VACUUM, it hasn't changed. However, if I drop and then recreate this index, the size becomes much smaller (almost half the size): drop index asset_positions_position_idx; DROP INDEX CREATE INDEX asset_positions_position_idx ON asset_positions USING GIST (position GIST_GEOMETRY_OPS); CREATE INDEX select pg_relation_size('asset_positions_position_idx'); pg_relation_size ------------------ 6225920 (1 row) Is there something I am missing here, or is the reclaiming of dead tuples for these indexes just not working when I run a VACUUM? Is it suppose to work? -- Graham Davis Refractions Research Inc. gdavis@refractions.net