[PERFORM] Why creating GIN table index is so slow than inserting data into empty table with the same index?

2009-03-23 Thread Sergey Burladyan
example: select version(); version PostgreSQL 8.3.6 on i486-pc-linux-gnu, compiled by GCC gcc-4.3.real (Debian 4.3.3-3) 4.3.3 show maintenance_work_mem ; main

Re: [PERFORM] Why creating GIN table index is so slow than inserting data into empty table with the same index?

2009-03-23 Thread Tom Lane
Sergey Burladyan writes: > show maintenance_work_mem ; > maintenance_work_mem > -- > 128MB > create table a (i1 int, i2 int, i3 int, i4 int, i5 int, i6 int); > insert into a select n, n, n, n, n, n from generate_series(1, 10) as n; > create index arr_gin on a using gin (

Re: [PERFORM] Why creating GIN table index is so slow than inserting data into empty table with the same index?

2009-03-24 Thread Heikki Linnakangas
Tom Lane wrote: Sergey Burladyan writes: show maintenance_work_mem ; maintenance_work_mem -- 128MB create table a (i1 int, i2 int, i3 int, i4 int, i5 int, i6 int); insert into a select n, n, n, n, n, n from generate_series(1, 10) as n; create index arr_gin on a usin

Re: [PERFORM] Why creating GIN table index is so slow than inserting data into empty table with the same index?

2009-03-24 Thread Tom Lane
Heikki Linnakangas 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