Re: Rule vs Trigger - Mailing list pgsql-general

From Joshua D. Drake
Subject Re: Rule vs Trigger
Date
Msg-id 46813C40.6020602@commandprompt.com
Whole thread Raw
In response to Re: Rule vs Trigger  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Tom Lane wrote:
> "Albe Laurenz" <all@adv.magwien.gv.at> writes:
>> Richard Broersma Jr wrote:

>> A rule would only
>> execute one additional statement. So if you can do it with a rule
>> conveniently, the rule will probably be faster.
>
> I find this unlikely.  The overhead involved in setting up a rule
> is probably larger than that involved in calling a trigger.
> The real question is whether you need access to the modified data
> or not --- a statement-level trigger doesn't currently get that.

Not that Tom ever needs any backing up, but when we started testing
partitioning, we first tested with rules and then tested with triggers.
Triggers are quite a bit faster than rules.

Joshua D. Drake


>
>             regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
>                http://archives.postgresql.org/
>


--

       === The PostgreSQL Company: Command Prompt, Inc. ===
Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240
Providing the most comprehensive  PostgreSQL solutions since 1997
              http://www.commandprompt.com/

Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate
PostgreSQL Replication: http://www.commandprompt.com/products/


pgsql-general by date:

Previous
From: Harald Fuchs
Date:
Subject: Re: Duplicate records returned
Next
From: "news.gmane.org"
Date:
Subject: Re: a JOIN on same table, but 'slided over'