Merge lp:~michael.nelson/launchpad/616331-private-builds-in-builder-history into lp:launchpad/db-devel
| Status: | Merged | ||||
|---|---|---|---|---|---|
| Approved by: | Edwin Grubbs on 2010-08-11 | ||||
| Approved revision: | no longer in the source branch. | ||||
| Merged at revision: | 9650 | ||||
| Proposed branch: | lp:~michael.nelson/launchpad/616331-private-builds-in-builder-history | ||||
| Merge into: | lp:launchpad/db-devel | ||||
| Diff against target: |
82 lines (+21/-32) 1 file modified
lib/lp/buildmaster/model/buildfarmjob.py (+21/-32) |
||||
| To merge this branch: | bzr merge lp:~michael.nelson/launchpad/616331-private-builds-in-builder-history | ||||
| Related bugs: |
|
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Julian Edwards (community) | release-critical | 2010-08-11 | Approve on 2010-08-12 |
| Edwin Grubbs (community) | code | 2010-08-11 | Approve on 2010-08-11 |
| Launchpad code reviewers | 2010-08-11 | Pending | |
|
Review via email:
|
|||
Commit Message
Fix timeout on builder history page by replacing nested joins in query
Description of the Change
Overview
========
We started seeing timeouts on dogfood (and apparently staging) recently for the builder history page. This branch fixes those timeouts.
Details
=======
Pre-implementation discussion (and help from stub to fix the query) can be seen at bug 616331.
The branch replaces the nested joins with normal joins. I was not able to get rid of the COALESCE.
To test:
========
bin/test -vvm test_buildfarmjob -t TestBuildFarmJobSet
I've also merged this branch on dogfood so that the page now displays fine at:
https:/
No lint.
As per the discussion on the bug, this will either be included in the re-roll or a CP.
| Michael Nelson (michael.nelson) wrote : | # |
On Wed, Aug 11, 2010 at 7:54 PM, Edwin Grubbs
<email address hidden> wrote:
> Review: Approve code
> Hi Michael,
>
> This is a nice improvement. Since the TeamParticipation table won't be used if the user is anonymous or an admin, it would be a small but easy optimization to not join it into those queries. For example:
>
> origin = [
> BuildFarmJob,
> LeftJoin(
> LeftJoin(Archive, ...),
> ]
>
> if ANONYMOUS:
> ...
> elif ADMIN:
> ...
> else:
> origin.
>
> filtered_builds = IStore(
>
> I guess if an admin is running the query, there is no reason to use any tables besides BuildFarmJob.
Yes... good point. I've attached an incremental (pushed as r9651) that
only uses the joins when necessary. Thanks!

Hi Michael,
This is a nice improvement. Since the TeamParticipation table won't be used if the user is anonymous or an admin, it would be a small but easy optimization to not join it into those queries. For example:
origin = [ PackageBuild, ...),
BuildFarmJob,
LeftJoin(
LeftJoin(Archive, ...),
]
if ANONYMOUS: append( LeftJoin( TeamParticipati on, ...))
...
elif ADMIN:
...
else:
origin.
filtered_builds = IStore( BuildFarmJob) .using( *origin) .find(. ..)
I guess if an admin is running the query, there is no reason to use any tables besides BuildFarmJob.
-Edwin