Distribution:+bugs timeouts

Bug #717394 reported by Robert Collins
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
Critical
Robert Collins

Bug Description

We've improved the performance of the search, but that has just reduced the frequency of timeouts, it still times out.

OOPS-1868M2484

https://bugs.launchpad.net/ubuntu/+bugs?field.searchtext=grub_xputs&orderby=-importance&search=Search&field.status:list=NEW&field.status:list=INCOMPLETE_WITH_RESPONSE&field.status:list=INCOMPLETE_WITHOUT_RESPONSE&field.status:list=CONFIRMED&field.status:list=TRIAGED&field.status:list=INPROGRESS&field.status:list=FIXCOMMITTED&field.assignee=&field.bug_reporter=&field.omit_dupes=on&field.has_patch=&field.has_no_package=

There are two repeated queries that combine to use up 3.5 seconds of time:

2 16 1817 113 1704 SQL-launchpad-main-slave
SELECT COUNT(*)
FROM BugTask
JOIN Bug ON BugTask.bug = Bug.id
WHERE Bug.id = BugTask.bug
  AND BugTask.distroseries = $INT
  AND ((BugTask.status = $INT)
       OR (BugTask.status = $INT)
       OR (BugTask.status = $INT)
       OR (BugTask.status = $INT)
       OR (BugTask.status = $INT)
       OR (BugTask.status = $INT))
  AND Bug.duplicateof IS NULL
  AND (Bug.private = FALSE
       OR EXISTS
         (SELECT BugSubscription.bug
          FROM BugSubscription,
               TeamParticipation
          WHERE TeamParticipation.person = $INT
            AND TeamParticipation.team = BugSubscription.person
            AND BugSubscription.bug = Bug.id
          UNION SELECT BugTask.bug
          FROM BugTask,
               TeamParticipation
          WHERE TeamParticipation.person = $INT
            AND TeamParticipation.team = BugTask.assignee
            AND BugTask.bug = Bug.id))

4 14 2305 164 2141 SQL-launchpad-main-slave
SELECT COUNT(*)
FROM BugTask
JOIN Bug ON BugTask.bug = Bug.id
WHERE Bug.id = BugTask.bug
  AND ((BugTask.status = $INT)
       OR (BugTask.status = $INT)
       OR (BugTask.status = $INT)
       OR (BugTask.status = $INT)
       OR (BugTask.status = $INT)
       OR (BugTask.status = $INT))
  AND BugTask.milestone = $INT
  AND Bug.duplicateof IS NULL
  AND (Bug.private = FALSE
       OR EXISTS
         (SELECT BugSubscription.bug
          FROM BugSubscription,
               TeamParticipation
          WHERE TeamParticipation.person = $INT
            AND TeamParticipation.team = BugSubscription.person
            AND BugSubscription.bug = Bug.id
          UNION SELECT BugTask.bug
          FROM BugTask,
               TeamParticipation
          WHERE TeamParticipation.person = $INT
            AND TeamParticipation.team = BugTask.assignee
            AND BugTask.bug = Bug.id))

Tags: qa-ok timeout

Related branches

Revision history for this message
Robert Collins (lifeless) wrote :

explainable by series and milestone targeted bugs; probably setting a lower limit for /all/ ubuntu wide bug search performance.

Revision history for this message
Robert Collins (lifeless) wrote :

Ok, union based queries for this sum rather poorly; a direct crafted query completes in 190ms for 13 series, union appears to be 40ms per query fragment more or less, which would be worse at 1/5th the series.

Revision history for this message
Launchpad QA Bot (lpqabot) wrote :
Changed in launchpad:
assignee: nobody → Robert Collins (lifeless)
milestone: none → 11.03
tags: added: qa-needstesting
Changed in launchpad:
status: Triaged → Fix Committed
Revision history for this message
Robert Collins (lifeless) wrote :

The problem search is down to 7.5 seconds on staging.

tags: added: qa-ok
removed: qa-needstesting
Changed in launchpad:
status: Fix Committed → In Progress
Revision history for this message
Robert Collins (lifeless) wrote :

8 seconds of 12 in prod are the search; the remaining 4 seconds come from:
0.9 - 32 person lookups
0.3 - 16 repeated milestone lookups (I have a fix)
1.2 seconds in milestone bug summaries (I have a fix)
==
2.4 - the last 1.6 seconds are death by little cuts.

Revision history for this message
Launchpad QA Bot (lpqabot) wrote :
tags: added: qa-needstesting
removed: qa-ok
Changed in launchpad:
status: In Progress → Fix Committed
Revision history for this message
Launchpad QA Bot (lpqabot) wrote :
tags: added: qa-ok
removed: qa-needstesting
Changed in launchpad:
status: Fix Committed → Fix Released
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.