Does Triggers in MySQL for Audit Log Slows Down The Main update Insert or delete process?
views:
70answers:
1
+2
A:
If the triggers are set on insert and delete operations, yes it does, it's only a matter of how much. Setting up a trigger is simply a way to tell the database engine to do more work so it takes more time.
Tomislav Nakic-Alfirevic
2010-03-25 08:27:33
@Tomi ThankS Tomi
OM The Eternity
2010-03-25 08:40:42
What would be thr effect of trigger on Update query? Isnt there any effect on it as on Insert and Delete as u said?
OM The Eternity
2010-03-25 08:42:51
Also please go throught this link http://stackoverflow.com/questions/2505818/please-help-for-the-trigger-related-to-question779320 and let me know how I can Accomplish this?
OM The Eternity
2010-03-25 08:46:43
If you create a trigger to be executed "on update" as well, it will also slow down updates. As for the question you liked to, I think the reason it has no answers is that it isn't very clear. If you explain the problem better, it will be easier to answer.
Tomislav Nakic-Alfirevic
2010-03-25 09:17:31
@Tomi Check This : http://forums.mysql.com/read.php?99,360049,360049#msg-360049
OM The Eternity
2010-03-25 09:19:25
I think I understand, but I don't think there's an automatic way to go about it, not the way you designed your audit tables. If your audit tables had the same structure as the base tables, however, you could simplyy define the trigger to insert the complete new row without listing the specific fields. However, you would still have to update the audit table definition when you change something in the base table definition.
Tomislav Nakic-Alfirevic
2010-03-25 09:55:39
@Tomi Thanks For Guideliness Tomi....
OM The Eternity
2010-03-25 10:06:34
You're welcome. :)
Tomislav Nakic-Alfirevic
2010-03-25 10:28:25