Projects:Improved Trigger Disabling In PostgreSQL/QA
Performance
Before this refactor, we detected in actual customer transactions taking around 20 minutes to complete having disabled triggers, that were preventing vacuum to purge dead rows in ad_session_status
table, when in this situation, query to check whether triggers were active, degraded very quickly from few milliseconds to up to 3-5 seconds, making the rest of transactions invoking triggers to be very slow.
After this refactor, execution time of queries to check triggers status are kept stable regardless there are long transactions in execution.
Automated test
As this functionality is currently indirectly tested whenever tickets are created, there's no need to create ad-hoc testing for it.