Re: Need advice about triggers - Mailing list pgsql-performance

From scott.marlowe
Subject Re: Need advice about triggers
Date
Msg-id Pine.LNX.4.33.0309090738230.13569-100000@css120.ihs.com
Whole thread Raw
In response to Need advice about triggers  ("Mindaugas Riauba" <mind@bi.lt>)
List pgsql-performance
On Tue, 9 Sep 2003, Mindaugas Riauba wrote:

>
>   Hello,
>
>   I have small table (up to 10000 rows) and every row will be updated
> once per minute. Table also has "before update on each row" trigger
> written in plpgsql. But trigger 99.99% of the time will do nothing
> to the database. It will just compare old and new values in the row
> and those values almost always will be identical.

If the rows aren't going to actually change all that often, perhaps you
could program your trigger to just silently drop the update, i.e. only
change the rows that need updating and ignore the rest?  That should speed
things up.  Unless I'm misunderstanding your needs here.


pgsql-performance by date:

Previous
From: Pailloncy Jean-Gérard
Date:
Subject: Re: slow plan for min/max
Next
From: Tom Lane
Date:
Subject: Re: Need advice about triggers