Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Better one big trigger or many small?

Re: Better one big trigger or many small?

From: J Alex <jalexanderssd_at_yahoo.com>
Date: Tue, 26 Feb 2002 11:56:57 GMT
Message-ID: <dKKe8.284663$jO5.37079398@typhoon.tampabay.rr.com>

"Carlos" <miotromailcarlos_at_netscape.net> wrote in message news:1de5ebe7.0202260329.624b085b_at_posting.google.com...
> I am wondering about the benefits of creating one big trigger (i.e.
> AFTER INSERT, UPDATE OR DELETE) instead of creating many small
> triggers ( AFTER INSERT, AFTER INSERT, AFTER DELETE) per table.
> I think the performance will be better with the three small ones, but
> I'm not sure.
> Another side to concern is the amount of triggers (three or more per
> table), with the complications of maintenance for all of them.
>
> Advices will be appreciated.
>
> Thanks & regards from Spain.
>

That's an easy one - in tracking down problems, triggers are often overlooked, so you want to make it as simple to grasp as possible. Figuring out what 3 triggers did is much messier than looking at one bundle of code. Especially when you have to also consider what order did the many triggers fire in (i.e. which 'after insert' trigger fired first?) What I have found works best - A single trigger that calls a db procedure that is thoroughly commented. Very easy to read and maintain. Received on Tue Feb 26 2002 - 05:56:57 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US