Re: Rule vs Trigger

From: Richard Broersma Jr <rabroersma(at)yahoo(dot)com>
To: rongkai(dot)zhao(at)gmail(dot)com, pgsql-general(at)postgresql(dot)org
Subject: Re: Rule vs Trigger
Date: 2007-06-25 22:00:16
Message-ID: 429554.53548.qm@web31801.mail.mud.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

--- Alfred Zhao <rongkai(dot)zhao(at)gmail(dot)com> wrote:
> Suppose I want to update a statistics table S after an insertion into an
> activity table A. In order to update S automatically, I can either create a
> rule on A or create an after trigger on A. What's the performance
> implication on using rule vs trigger? Thanks in advance.

My understanding is that Triggers offer better performance than rules do.

However, one important advantage of triggers over rules is that rules are not able to correctly
handle DML statements that affects more than one record in a single statement.

Regards,
Richard Broersma Jr.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Richard Broersma Jr 2007-06-25 22:06:03 Re: CHECK
Previous Message Erik Jones 2007-06-25 21:54:24 Re: Standby servers and incrementally updated backups