From: pgsql-performance-owner@xxxxxxxxxxxxxx [mailto:pgsql-performance-owner@xxxxxxxxxxxxxx]
On Behalf Of Andreas Joseph Krogh Hi all. Using PG-9.4.0 I'm seeing this trying to delete from an "entity"-master table: *# explain analyze delete from onp_crm_entity where entity_id IN (select tmp.delivery_id from temp_delete_delivery_id tmp); Trigger for constraint ... Trigger for constraint ... Trigger for constraint ... I have lots of tables referencing onp_crm_entity(entity_id) so I expect the poor performance of deleting from it is caused by all the triggers firing to check FKI-constraints. Andreas, do you have indexes on FK columns in child tables? If not – there is your problem. Regards, Igor Neyman |