tags:

views:

70

answers:

1

Does Triggers in MySQL for Audit Log Slows Down The Main update Insert or delete process?

+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
@Tomi ThankS Tomi
OM The Eternity
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
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
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
@Tomi Check This : http://forums.mysql.com/read.php?99,360049,360049#msg-360049
OM The Eternity
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
@Tomi Thanks For Guideliness Tomi....
OM The Eternity
You're welcome. :)
Tomislav Nakic-Alfirevic