'PostgreSQL: Trigger makes read operation slower
I am using PostgreSQL version 11.11.
I have a trigger which collects data from 5 different related tables (let's say t1, t2, t3, t4, t5) and inserts it into another table (let's say t6). The trigger starts after insert, delete and update against tables t4 and t5. There are more than 1 million rows in each table. I expected that execution of trigger could take time, but even the read operation (select-query) from tables t1,t2,t3 (not from tables t4, t5) takes much more time than it was before trigger created (it's three-four times slower now).
Can the triggers affect read operation (select-query)? Do the triggers influence on tables without triggers?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
