Skip site navigation (1) Skip section navigation (2)

Re: tsvector_update_trigger performance?

From: Oleg Bartunov <oleg(at)sai(dot)msu(dot)su>
To: Chris St Denis <lists(at)on-track(dot)ca>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: tsvector_update_trigger performance?
Date: 2009-06-24 07:27:21
Message-ID: Pine.LNX.4.64.0906241126360.17118@sn.sai.msu.ru (view raw or flat)
Thread:
Lists: pgsql-performance
On Wed, 24 Jun 2009, Chris St Denis wrote:

> Is tsvector_update_trigger() smart enough to not bother updating a tsvector 
> if the text in that column has not changed?

no, you should do check yourself. There are several examples in mailing lists.

>
> If not, can I make my own update trigger with something like
>
>   if new.description != old.description
>       return tsvector_update_trigger('fti_all', 'pg_catalog.english',
>   'title', 'keywords', 'description');
>   else
>       return new;
>
> or do I need to do it from scratch?
>
>
> I'm seeing very high cpu load on my database server and my current theory is 
> that some of the triggers may be causing it.
>

 	Regards,
 		Oleg
_____________________________________________________________
Oleg Bartunov, Research Scientist, Head of AstroNet (www.astronet.ru),
Sternberg Astronomical Institute, Moscow University, Russia
Internet: oleg(at)sai(dot)msu(dot)su, http://www.sai.msu.su/~megera/
phone: +007(495)939-16-83, +007(495)939-23-83

In response to

Responses

pgsql-performance by date

Next:From: Mathieu NebraDate: 2009-06-24 07:42:30
Subject: Re: How would you store read/unread topic status?
Previous:From: Chris St DenisDate: 2009-06-24 07:20:18
Subject: tsvector_update_trigger performance?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group