From: hubert depesz lubaczewski <depesz@depesz.com>
To: Heikki Linnakangas <hlinnaka@iki.fi>
Cc: pgsql-bugs <pgsql-bugs@postgresql.org>
Subject: Re: GiST index for pgtrgm bloats a lot
Date: Mon, 18 May 2015 15:36:48 +0200
Message-ID: <20150518133648.GA22898@depesz.com> (raw)
In-Reply-To: <5559E6ED.2010405@iki.fi>
References: <20150518121250.GA19976@depesz.com>
<5559E6ED.2010405@iki.fi>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: depesz@depesz.com, hlinnaka@iki.fi
Subject: Re: GiST index for pgtrgm bloats a lot
In-Reply-To: <20150518133648.GA22898@depesz.com>
References: <20150518121250.GA19976@depesz.com> <5559E6ED.2010405@iki.fi> <20150518133648.GA22898@depesz.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox