Re: Why creating GIN table index is so slow than inserting data into empty table with the same index? - Mailing list pgsql-performance

From Tom Lane
Subject Re: Why creating GIN table index is so slow than inserting data into empty table with the same index?
Date
Msg-id 26264.1237902313@sss.pgh.pa.us
Whole thread Raw
In response to Re: Why creating GIN table index is so slow than inserting data into empty table with the same index?  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
List pgsql-performance
Heikki Linnakangas <heikki.linnakangas@enterprisedb.com> writes:
> Tom Lane wrote:
>> I think a reasonable solution for this might be to keep an eye on
>> maxdepth and force a flush if that gets too large (more than a few
>> hundred, perhaps?).  Something like this:

> I fooled around with a balanced tree, which solved the problem but
> unfortunately made the unsorted case slower.

Yeah, rebalancing the search tree would fix that, but every balanced
tree algorithm I know about is complicated, slow, and needs extra
memory.  It's really unclear that it'd be worth the trouble for a
transient data structure like this one.

            regards, tom lane

pgsql-performance by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: Why creating GIN table index is so slow than inserting data into empty table with the same index?
Next
From: Joe Uhl
Date:
Subject: Re: High CPU Utilization