Re: very long update gin index troubles back? - Mailing list pgsql-general

From Ivan Sergio Borgonovo
Subject Re: very long update gin index troubles back?
Date
Msg-id 20090124182429.1e7ee15d@dawn.webthatworks.it
Whole thread Raw
In response to Re: very long update gin index troubles back?  (Teodor Sigaev <teodor@sigaev.ru>)
Responses Re: very long update gin index troubles back?
List pgsql-general
On Sat, 24 Jan 2009 15:54:37 +0300
Teodor Sigaev <teodor@sigaev.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


pgsql-general by date:

Previous
From: Ian Sollars
Date:
Subject: dblink syntax question for remotely invoking void-returning procedures
Next
From: Jasen Betts
Date:
Subject: Re: conditional execution of insert/update-s