Merge lp:~michael.nelson/launchpad/616331-private-builds-in-builder-history into lp:launchpad/db-devel
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Edwin Grubbs | ||||
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 | Approve | |
Edwin Grubbs (community) | code | Approve | |
Launchpad code reviewers | Pending | ||
Review via email: mp+32355@code.launchpad.net |
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.
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