I have a materialized view which takes around 57 second to be created and I'm using PostgreSQL 9.4.
When I do an insert into a table, a trigger will call a trigger function which will do a
REFRESH MATERIALIZED VIEW CONCURRENTLY view the trigger fires
after each statement (insert,update,delete)
What happens is, to do a insert it will take around 57 seconds.
How can I fix this and still use a materialized view?
I had this implemented for a long time, and never had this problem, recently I've added pgbouncer, can it be the cause of this?