Open tpurschke opened 3 weeks ago
fresh install with single import of full config (no historical data): upgrade including deletion of managements takes 9 min. so not reproducible in this way :-(
the following change might speed things up - needs to be tested
drop trigger IF exists refresh_view_rule_with_owner_delete_trigger ON recertification CASCADE;
CREATE OR REPLACE FUNCTION refresh_view_rule_with_owner_deferred()
RETURNS TRIGGER AS $$
BEGIN
-- Call the refresh function only once at the end of the transaction
PERFORM refresh_view_rule_with_owner();
RETURN NULL;
END;
$$ LANGUAGE plpgsql;
-- create trigger refresh_view_rule_with_owner_delete_trigger
-- after delete on recertification for each statement
-- execute procedure refresh_view_rule_with_owner();
CREATE CONSTRAINT TRIGGER refresh_view_rule_with_owner_delete_trigger
AFTER DELETE ON recertification
DEFERRABLE INITIALLY DEFERRED
FOR EACH ROW
EXECUTE FUNCTION refresh_view_rule_with_owner_deferred();
when the database is not empty, the deletion of a test management while upgrading takes a very long time even though the test manager is not really big.
Try to debug this - isolate the part of the cascade that is the bottle-neck.
Test data available here: https://xfer.cactus.de/index.php/f/695887