From: | Ivan Sergio Borgonovo <mail(at)webthatworks(dot)it> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: very long update gin index troubles back? |
Date: | 2009-01-24 17:24:29 |
Message-ID: | 20090124182429.1e7ee15d@dawn.webthatworks.it |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Sat, 24 Jan 2009 15:54:37 +0300
Teodor Sigaev <teodor(at)sigaev(dot)ru> wrote:
> GIN index is slow for update by its construction. When you update
> the rows with or without columns indexed by GIN, postgres (in most
> cases) will insert new records, so index insertion will occur. So,
> for large updates it's much cheaper to drop and create index.
>
> That was a one of reasons to develop fast_insert_gin patch which
> now in review process.
Somehow the update succeeded... but for better preparing to the
future...
I'm not sure I understood, so I'll provide more details.
I've something like:
create table t1(
agg tsvector,
a varchar(10),
b varchar(10),
c varchar(10),
d int
);
then 2 triggers that for every update to t1 fill up agg.
agg:=tsvactor(coalesce(a,'')) || tsvactor(coalesce(b,'')) ||
tsvactor(coalesce(c,''));
and I have a gin index on agg.
No matter if I drop the trigger that update agg content and the fact
that I'm just updating d, postgresql will update the index?
Right?
--
Ivan Sergio Borgonovo
http://www.webthatworks.it
From | Date | Subject | |
---|---|---|---|
Next Message | Jasen Betts | 2009-01-25 01:18:11 | Re: conditional execution of insert/update-s |
Previous Message | Ian Sollars | 2009-01-24 16:23:09 | dblink syntax question for remotely invoking void-returning procedures |