views:

282

answers:

2

When an AFTER UPDATE or AFTER INSERT trigger is fired is it a synchronous or asynchronous event? In other words does it hold up the total execution time of the query that tripped the trigger?

+6  A: 

Trigger are not asynch. Yes, they will increase the time it takes for an update or insert to complete.

tpdi
+1  A: 

Yes, for example if you write an AFTER INSERT trigger to record the insert in another log table, you can be certain that the main INSERT and the insert to the log table happen as an atomic operation. When the main INSERT returns, all other work done by triggers (both BEFORE and AFTER triggers) is also complete.

Bill Karwin