Merge lp:~adeuring/launchpad/bug-799785 into lp:launchpad
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Abel Deuring | ||||
Approved revision: | no longer in the source branch. | ||||
Merged at revision: | 13274 | ||||
Proposed branch: | lp:~adeuring/launchpad/bug-799785 | ||||
Merge into: | lp:launchpad | ||||
Diff against target: |
26 lines (+3/-5) 1 file modified
lib/lp/registry/model/distribution.py (+3/-5) |
||||
To merge this branch: | bzr merge lp:~adeuring/launchpad/bug-799785 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Graham Binns (community) | code | Approve | |
Review via email: mp+65373@code.launchpad.net |
Commit message
[r=gmb][bug=799785] Faster evaluation of Distribution.
Description of the change
This branch fixes bug 799785: Timeout when trying to set the translation focus for Ubuntu
The OOPS report from this bug shows one very long query, which is issued in Snapshot(
The query is a UNION of two subqueries; an EXPLAIN ANALYZE on staging (thanks Deryck!) of it showed:
- one of the sub-queries needed 14 seconds; the other sub-query needed <20 milliseconds.
- the first sub-query needed 10 seconds (or even more -- I did not look that carefully at every line of the EXPLAIN ANALYZE output..,) to sort the result.
- Merging and sorting the two sub-queries required an external disk merge, occupying 46912kB; it took 7 seconds.
The property Distribution.
Another run of EXPLAIN ANALZYE of only the first, originally slow, query, but now originating from
archive.
needed < 40 milliseoncds.
So we can simply loop over self.all_
Since we have just two archive_sources even for Ubuntu, I am not concerned about a slow loop execution, caused by a loop over a large number of empty archive_sources for any distribution.
I did not add any test (not sure if we can properly test SQL performance...); the existing short test in lib/lp/
So, just one existing check:
./bin/test registry -vvt doc.distributio
no lint