Re: Need advice about triggers

From: "scott(dot)marlowe" <scott(dot)marlowe(at)ihs(dot)com>
To: Mindaugas Riauba <mind(at)bi(dot)lt>
Cc: <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Need advice about triggers
Date: 2003-09-09 13:39:06
Message-ID: Pine.LNX.4.33.0309090738230.13569-100000@css120.ihs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2003-09-09 14:40:48 Re: Need advice about triggers
Previous Message Pailloncy Jean-Gérard 2003-09-09 13:36:24 Re: slow plan for min/max