/participants API timing out

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

Bug Description

https://lp-oops.canonical.com/oops.py/?oopsid=1681EB1195

https://api.edge.launchpad.net/beta/%7Eubuntu-dev/participants

SQL time: 7007 ms
Non-sql time: 2065 ms
Total time: 9072 ms
Statement Count: 472

This is suffering from death-by-a-thousand-cuts - every exported field on Person is being separately looked up.

Related branches

Changed in launchpad-registry:
status: New → Triaged
importance: Undecided → High
tags: added: timeout
Changed in launchpad-registry:
assignee: nobody → Robert Collins (lifeless)
Curtis Hovey (sinzui)
Changed in launchpad-registry:
status: Triaged → In Progress
milestone: none → 10.09
Revision history for this message
Ursula Junque (ursinha) wrote : Bug fixed by a commit
tags: added: qa-needstesting
Ursula Junque (ursinha)
Changed in launchpad-registry:
status: In Progress → Fix Committed
Revision history for this message
Ursula Junque (ursinha) wrote :
Revision history for this message
Robert Collins (lifeless) wrote :

Removed the qa-needstesting tag - this hasn't landed yet !

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

Ok, so a newer fix *has* landed, but a related (possibly key) issue makes it take 6 seconds to count(*) - it will probably be Just Fine on production, but a tweak to the query takes it down to 30ms, so I'm going to go ahead and do that.

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

SELECT COUNT(*) FROM Person JOIN TeamParticipation ON TeamParticipation.person = Person.id LEFT JOIN KarmaTotalCache ON KarmaTotalCache.person = Person.id LEFT JOIN PersonLocation ON PersonLocation.person = Person.id LEFT JOIN Archive ON Archive.owner = Person.id LEFT JOIN EmailAddress ON EmailAddress.person = Person.id LEFT JOIN account on person.account=account.id WHERE TeamParticipation.team = 238131 AND NOT (TeamParticipation.person = 238131) AND (Archive.id IS NULL OR Archive.id = (SELECT MIN(Archive.id) FROM Archive WHERE Archive.owner = Person.id) AND Archive.purpose = 2) AND (EmailAddress.status IS NULL OR (EmailAddress.status = 4 AND (account.status is NULL or account.status=20)));

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

New query tried out on staging (via losa help) - first batch is completely delivered in 3.5seconds to .au, so I'm proposing that to merge.

Revision history for this message
Launchpad QA Bot (lpqabot) wrote :
tags: added: qa-needstesting
Revision history for this message
Robert Collins (lifeless) wrote :

naughty bot :)

tags: removed: qa-needstesting
Revision history for this message
Ursula Junque (ursinha) wrote :

@lifeless If you don't want the bot to touch the bug, you should mark it as incremental! :) ec2 land --incremental or add [incr] tag to the commit msg manually; should do the trick.

Revision history for this message
Robert Collins (lifeless) wrote : Re: [Bug 615237] Re: /participants API timing out

On Thu, Aug 19, 2010 at 3:24 AM, Ursula Junque <email address hidden> wrote:
> @lifeless If you don't want the bot to touch the bug, you should mark it
> as incremental! :) ec2 land --incremental or add [incr] tag to the
> commit msg manually; should do the trick.

Yeah, problem is that:
 - the previous commit was *thought* to fix it [so arguably qa-bad], but
 - it didn't make it worse [so really just neutral]

:)

Changed in launchpad-registry:
status: In Progress → Fix Committed
tags: added: qa-ok
Revision history for this message
Launchpad QA Bot (lpqabot) wrote : Incremental fix
Curtis Hovey (sinzui)
Changed in launchpad-registry:
status: Fix Committed → Fix Released
Revision history for this message
Launchpad QA Bot (lpqabot) wrote : Bug fixed by a commit
Changed in launchpad-registry:
milestone: 10.09 → 10.10
tags: added: qa-needstesting
removed: qa-ok
tags: added: qa-ok
removed: qa-needstesting
Revision history for this message
Launchpad QA Bot (lpqabot) wrote :
tags: added: qa-needstesting
removed: qa-ok
tags: added: qa-ok
removed: qa-needstesting
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.