Re: [HACKERS] GIN index build speed

2008-12-21 Thread Jeff Davis
On Tue, 2008-12-02 at 12:12 +0200, Heikki Linnakangas wrote: > CREATE TABLE foo (bar tsvector); > INSERT INTO foo SELECT to_tsvector('foo' || a) FROM generate_series(1, > 20) a; > CREATE INDEX foogin ON foo USING gin (bar); > > The CREATE INDEX step takes about 40 seconds on my laptop, which

Re: [HACKERS] GIN index build speed

2008-12-02 Thread Teodor Sigaev
The issue is that the GIN index build code accumulates the lexemes into a binary tree, but there's nothing to keep the tree balanced. My test case with almost monotonically increasing keys, happens to be a worst-case scenario, and the tree degenerates into almost linked list that every insertio

[HACKERS] GIN index build speed

2008-12-02 Thread Heikki Linnakangas
While playing around with the "GIN fast insert" patch, I was puzzled why building a GIN index seemed to take so long. The test case I use was simply: CREATE TABLE foo (bar tsvector); INSERT INTO foo SELECT to_tsvector('foo' || a) FROM generate_series(1, 20) a; CREATE INDEX foogin ON foo US