Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YuLE1-0004i7-Ac for pgsql-bugs@arkaria.postgresql.org; Mon, 18 May 2015 13:36:57 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YuLE0-0001Fv-Qg for pgsql-bugs@arkaria.postgresql.org; Mon, 18 May 2015 13:36:56 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YuLDz-0001DX-6d for pgsql-bugs@postgresql.org; Mon, 18 May 2015 13:36:55 +0000 Received: from andy.depesz.com ([88.198.47.100] helo=depesz.com) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1YuLDv-0006cS-Qe for pgsql-bugs@postgresql.org; Mon, 18 May 2015 13:36:53 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=depesz.com; s=20140207; h=In-Reply-To:Content-Type:MIME-Version:References:Reply-To:Message-ID:Subject:Cc:To:Sender:From:Date; bh=sgP2F9bPHrvv0snYZ7Gj+hyY59wRSg+aD1zMHowO9+s=; b=Hold2oB7DBh7Ksx0kgT6oSUkC6SKzzWMsbeTi3Vg5PDC/pvFCUF5HGSKZfzCDzUjESVjvbOKDDMuCkwxgoOAtFR1eFH/ctg7HtiCPShscKWuCiYon6Ldy74H6Gu3Q1+e; Received: from andy.depesz.com ([88.198.47.100] helo=depesz.com) by depesz.com with esmtpa (Exim 4.85) (envelope-from ) id 1YuLDs-0006ge-KG; Mon, 18 May 2015 15:36:48 +0200 Date: Mon, 18 May 2015 15:36:48 +0200 From: hubert depesz lubaczewski To: Heikki Linnakangas Cc: pgsql-bugs Subject: Re: GiST index for pgtrgm bloats a lot Message-ID: <20150518133648.GA22898@depesz.com> Reply-To: depesz@depesz.com References: <20150518121250.GA19976@depesz.com> <5559E6ED.2010405@iki.fi> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <5559E6ED.2010405@iki.fi> User-Agent: Mutt/1.5.23 (2014-03-12) X-Pg-Spam-Score: -2.0 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org On Mon, May 18, 2015 at 04:19:41PM +0300, Heikki Linnakangas wrote: > Are the columns that are included in the bloated index also updated that > often? If not, I'd suggest moving those columns to a separate table with a > one-to-one relationship to the main table. Or perhaps just create a helper > table that contains copies of those columns, and keep it up-to-date with > triggers. That would reduce the churn in the index. I'm not sure if this is possible, but will look into it. > 1. When GiST has multiple equally good choices where it could insert a > tuple, it favours branches that are "earlier" in the index. Always > descending down the same branch is good for cache efficiency when you insert > multiple items with similar keys, but the downside is that the other > branches can easily have a lot of free space that goes unused, while the > "hot" branch just gets split repeatedly. This is explained in the comments > in the gistchoose() function. That leads to bloat, because the free space > isn't being used. This looks related. Too bad that we don't have any other way to handle it, but at the very least I know it's not some "bug", it's just a missing feature. Thanks a lot, depesz -- The best thing about modern society is how easy it is to avoid contact with it. http://depesz.com/ -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs