I have a big table( bo_sip_cti_event
) which is too largest to even run queries on this so I made the same table ( bo_sip_cti_event_day
), added trigger after insert on bo_sip_cti_event
to add all the same values to bo_sip_cti_event_day
and now I am thinking if I significantly slowed down inserts into bo_sip_cti_event
.
So generally, does trigger after insert slow down operations on this table?
Yes, the trigger must slow down inserts.
The reason is that relational databases are ACID compliant: All actions, including side-effects like triggers, must be completed before the update transaction completes. So triggers must be executed synchronously, and that consumes CPU, and in your case I/O too, which ultimately takes more time. There's no getting around it.
The answer is yes: it is additional overhead, so obviously it takes time to finish the transaction with the additional trigger execution.
Your design makes me wonder if:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.