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