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: Mark D Powell <mark.powell_at_eds.com>
Date: 26 Feb 2002 06:05:20 -0800
Message-ID: <178d2795.0202260605.416bf32b@posting.google.com>


"J Alex" <jalexanderssd_at_yahoo.com> wrote in message news:<dKKe8.284663$jO5.37079398_at_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.

I also vote for there being only one set of before or after insert, update, or delete triggers on a table. It is possible to combine these activities into one trigger, but I think it is easier to determine you need to look at something when the triggers are separated by insert, update, and delete and there is only one of each of these type of triggers on a table.

But this is just a personal preference.

Received on Tue Feb 26 2002 - 08:05:20 CST

Original text of this message

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