Thread: Triggers and performance
02-18-03, 07:06 #1Registered User
- Join Date
- Feb 2003
Unanswered: Triggers and performance
Here I am....triggers are becoming my best friends....my husband will be very jealous...
A question rose in my head while creating a trigger on a large and critical table....
There are impacts on performance using a trigger?
My table is read by on line transaction and updated in the same time....performance are our problem every day....
In a plan table for example does the trigger appear somehow?
Ah...for each trigger there is an insert that write the old row on a different table...
Someone has an idea?
Data Base Administrator
02-18-03, 09:27 #2Registered User
Provided Answers: 5
- Join Date
- Jan 2003
Yes, Triggers effect performance. Using you example where you have a Trigger basically performing a logging operation (copying rows to another table on Update and/or insert), DB2 will now have to perform an additional operation Iinsert) for every row that is inserted/updated in the master table, and inserts are the most expensive thing to execute in terms of performance. Even Triggers that do not do any I/O will have some performance drawback because it still requires CPU cycles to execute the trigger.
Triggers are nice, but to maximize performance, just use them judiciously--and that should allow your husband to see more of you