Use loose foreign key for deployment_clusters.cluster_id
This is similar to #360696 (closed), but for deployment_clusters
table.
This experiment shows that it can take 2 minutes to delete all deployment_clusters
, for the cluster with most deployments, which will also timeout.
The following discussion from !88887 (merged) should be addressed:
-
@Alexand started a discussion: (+2 comments) To fix the bug, I think we'll also have to take similar approach with the
deployments_cluster
table, which has aON DELETE CASCADE
FK relationship:See the test on database-lab (internal).
Should we also implement it here, or open a follow-up?
Edited by Tiger Watson