Deleting git repository with many MPs times out

Bug #1688026 reported by Colin Watson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
Triaged
Critical
Unassigned

Bug Description

OOPS-37cfede9eefb5b51adcbbef4f1a1b738 shows lots of missing bulk operations. The top ones are:

1. 188 572 3 569 SQL-main-master
DELETE
FROM BranchMergeProposalJob
WHERE BranchMergeProposalJob.id = $INT

2. 65 528 8 520 SQL-main-master
SELECT $INT
FROM (
SELECT GitRepository.default_branch,
       GitRepository.date_created,
       GitRepository.date_last_modified,
       GitRepository.description,
       GitRepository.distribution,
       GitRepository.id,
       GitRepository.information_type,
       GitRepository.name,
       GitRepository.owner_default,
       GitRepository.OWNER, GitRepository.project,
                            GitRepository.registrant,
                            GitRepository.repository_type,
                            GitRepository.reviewer,
                            GitRepository.sourcepackagename,
                            GitRepository.target_default
FROM GitRepository
WHERE GitRepository.id IN ($INT)
  AND (GitRepository.information_type IN ($INT, $INT)
  OR COALESCE((GitRepository.access_grants)&&
    (SELECT ARRAY_AGG(TeamParticipation.team)
     FROM TeamParticipation
     WHERE TeamParticipation.person = $INT), FALSE)
  OR COALESCE(ARRAY[(GitRepository.access_policy)]&&
                (SELECT ARRAY_AGG(AccessPolicyGrant.policy)
                 FROM AccessPolicyGrant
                 JOIN TeamParticipation ON TeamParticipation.team = AccessPolicyGrant.grantee
                 WHERE TeamParticipation.person = $INT), FALSE)) LIMIT $INT) AS "_tmp" LIMIT $INT

3. 62 375 6 369 SQL-main-master
DELETE
FROM CodeReviewMessage
WHERE CodeReviewMessage.id = $INT

4. 33 130 3 127 SQL-main-master
DELETE
FROM CodeReviewVote
WHERE CodeReviewVote.id = $INT

5. 32 160 5 155 SQL-main-master
SELECT BranchMergeProposal.commit_message,
       BranchMergeProposal.date_created,
       BranchMergeProposal.date_merged,
       BranchMergeProposal.date_review_requested,
       BranchMergeProposal.date_reviewed,
       BranchMergeProposal.description,
       BranchMergeProposal.id,
       BranchMergeProposal.merge_reporter,
       BranchMergeProposal.merged_revision_id,
       BranchMergeProposal.merged_revno,
       BranchMergeProposal.dependent_branch,
       BranchMergeProposal.dependent_git_commit_sha1,
       BranchMergeProposal.dependent_git_path,
       BranchMergeProposal.dependent_git_repository,
       BranchMergeProposal.queue_status,
       BranchMergeProposal.registrant,
       BranchMergeProposal.reviewed_revision_id,
       BranchMergeProposal.reviewer,
       BranchMergeProposal.root_message_id,
       BranchMergeProposal.source_branch,
       BranchMergeProposal.source_git_commit_sha1,
       BranchMergeProposal.source_git_path,
       BranchMergeProposal.source_git_repository,
       BranchMergeProposal.superseded_by,
       BranchMergeProposal.target_branch,
       BranchMergeProposal.target_git_commit_sha1,
       BranchMergeProposal.target_git_path,
       BranchMergeProposal.target_git_repository,
       BranchMergeProposal.whiteboard
FROM BranchMergeProposal
WHERE BranchMergeProposal.superseded_by = $INT
ORDER BY BranchMergeProposal.date_created DESC, BranchMergeProposal.id

6. 32 151 4 147 SQL-main-master
SELECT CodeReviewVote.branch_merge_proposal,
       CodeReviewVote.vote_message,
       CodeReviewVote.date_created,
       CodeReviewVote.id,
       CodeReviewVote.registrant,
       CodeReviewVote.review_type,
       CodeReviewVote.reviewer
FROM CodeReviewVote
WHERE CodeReviewVote.branch_merge_proposal = $INT

7. 32 91 2 89 SQL-nostore
SELECT Webhook.active,
       Webhook.branch,
       Webhook.date_created,
       Webhook.date_last_modified,
       Webhook.delivery_url,
       Webhook.git_repository,
       Webhook.id,
       Webhook.json_data,
       Webhook.registrant,
       Webhook.secret,
       Webhook.snap
FROM Webhook
WHERE Webhook.git_repository = $INT
ORDER BY Webhook.id

8. 31 456 14 442 SQL-main-master
SELECT BranchMergeProposalJob.json_data,
       BranchMergeProposalJob.branch_merge_proposal,
       BranchMergeProposalJob.id,
       BranchMergeProposalJob.job,
       BranchMergeProposalJob.job_type
FROM BranchMergeProposalJob
WHERE BranchMergeProposalJob.branch_merge_proposal = $INT

9. 31 207 6 201 SQL-main-master
SELECT CodeReviewMessage.branch_merge_proposal,
       CodeReviewMessage.id,
       CodeReviewMessage.message,
       CodeReviewMessage.vote,
       CodeReviewMessage.vote_tag
FROM CodeReviewMessage
WHERE CodeReviewMessage.branch_merge_proposal = $INT

10. 31 161 5 156 SQL-main-master
DELETE
FROM BranchMergeProposal
WHERE BranchMergeProposal.id = $INT

11. 31 121 3 118 SQL-main-master
DELETE
FROM PreviewDiff
WHERE PreviewDiff.branch_merge_proposal = $INT

12. 10 26 2 24 SQL-main-master
DELETE
FROM CodeReviewInlineComment
WHERE CodeReviewInlineComment.previewdiff IN ($INT)

13. 10 25 2 23 SQL-main-master
DELETE
FROM CodeReviewInlineCommentDraft
WHERE CodeReviewInlineCommentDraft.previewdiff IN ($INT)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.