pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
Cc: Sergey Burladyan <eshkinkot@gmail.com>
Cc: Oleg Bartunov <oleg@sai.msu.su>
Cc: Teodor Sigaev <teodor@sigaev.ru>
Cc: pgsql-performance@postgresql.org
Subject: Re: Why creating GIN table index is so slow than inserting data into empty table with the same index?
Date: Tue, 24 Mar 2009 09:45:13 -0400
Message-ID: <26264.1237902313@sss.pgh.pa.us> (raw)
In-Reply-To: <49C8BEF6.3080909@enterprisedb.com>
References: <874oxjrb0p.fsf@seb.progtech.ru>
	<18581.1237865712@sss.pgh.pa.us>
	<49C8BEF6.3080909@enterprisedb.com>

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




view thread (4+ messages)

Message-ID: <26264.1237902313@sss.pgh.pa.us>
Permalink:  ../26264.1237902313@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/26264.1237902313@sss.pgh.pa.us

 · 

reply

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 using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, heikki.linnakangas@enterprisedb.com, eshkinkot@gmail.com, oleg@sai.msu.su, teodor@sigaev.ru
  Subject: Re: Why creating GIN table index is so slow than inserting data into empty table with the same index?
  In-Reply-To: <26264.1237902313@sss.pgh.pa.us>

* 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