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: Oracle triggers = poor performance ??

Re: Oracle triggers = poor performance ??

From: <michael_bialik_at_my-deja.com>
Date: Fri, 30 Jul 1999 19:04:19 GMT
Message-ID: <7nssva$ser$1@nnrp1.deja.com>


Hi.

 If you don't have any application logic - stick with  FK and ON DELETE CASCADE/RESTRICT clauses.  It is more efficient than triggers.
 Use triggers only if some logic involved.  For your example - use FK & ON DELETE CASCADE - it's  enough.

 Good luck. Michael.

In article <rq1ike$0$37nspbj$3e_at_corp.supernews.com>,   "Edmund Landgraf" <elandgraf_at_nospam.1rent.com> wrote:
> I've heard Oracle triggers really impact performance. I'm using
ErWin and
> am trying to decide if I should use triggers to enforce RI in
addition to my
> foreign key constraints. With triggers, for example, I have the
ability to
> cascade, restrict or orphan child nodes when a parent is either
inserted,
> updated, or deleted. Can I get that flexibility with keywords off of
the
> constraints (e.g. cascade delete)???
>
> Here's a typical cascade delete trigger: (table address has two
children,
> useraddress and propertyaddress)
>
> Thoughts????
>
> thx in adv.
> -Ed
>
> declare numrows INTEGER;
> begin
> /* ERwin Builtin Thu Jul 29 13:47:02 1999 */
> /* Address R/268 UserAddress ON PARENT DELETE CASCADE */
> delete from UserAddress
> where
> /* %JoinFKPK(UserAddress,:%Old," = "," and") */
> UserAddress.AddressID = :old.AddressID;
>
> /* ERwin Builtin Thu Jul 29 13:47:02 1999 */
> /* Address R/266 PropertyAddress ON PARENT DELETE CASCADE */
> delete from PropertyAddress
> where
> /* %JoinFKPK(PropertyAddress,:%Old," = "," and") */
> PropertyAddress.AddressID = :old.AddressID;
>
> -- ERwin Builtin Thu Jul 29 13:47:02 1999
> end;
>
>

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't. Received on Fri Jul 30 1999 - 14:04:19 CDT

Original text of this message

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