Merge lp:~wallyworld/launchpad/ppa-packages-timeout-1071581 into lp:launchpad
| Status: | Superseded | ||||
|---|---|---|---|---|---|
| Proposed branch: | lp:~wallyworld/launchpad/ppa-packages-timeout-1071581 | ||||
| Merge into: | lp:launchpad | ||||
| Diff against target: |
448 lines (+228/-55) 7 files modified
database/schema/security.cfg (+3/-0) lib/lp/registry/browser/person.py (+8/-8) lib/lp/registry/model/person.py (+27/-47) lib/lp/scripts/garbo.py (+108/-0) lib/lp/soyuz/configure.zcml (+6/-0) lib/lp/soyuz/interfaces/reporting.py (+25/-0) lib/lp/soyuz/model/reporting.py (+51/-0) |
||||
| To merge this branch: | bzr merge lp:~wallyworld/launchpad/ppa-packages-timeout-1071581 | ||||
| Related bugs: |
|
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Curtis Hovey (community) | code | 2012-10-31 | Needs Information on 2012-10-31 |
|
Review via email:
|
|||
This proposal has been superseded by a proposal from 2012-11-02.
Commit Message
Improve the query used to find person related software
Description of the Change
== Pre Implementation ==
Discussed with wgrant.
== Implementation ==
So Postgres cannot efficiently execute the required DISTINCT ON query needed to only find the latest published packages. So we need to dumb down the query and perform the grouping in Python. The functionality is split into 2 parts:
1. Perform a query with the required WHERE conditions, iterate over the result in batches, and gather the required SourcePackageRe
2. Set up a result set using SourcePackageRe
New indexes on SourcePackageRe
== Tests ==
Internal change - use existing tests.
== Lint ==
Checking for conflicts and issues in changed files.
Linting changed files:
database/
lib/lp/
lib/lp/
| Ian Booth (wallyworld) wrote : | # |
I am going to scrap this work as is - it turns out there will still be
performance issues for some users, those who will have many 1000s of
records to be displayed. I was of the assumption that the number of
records would normally be much smaller than that.
So the plan now is to introduce a new denormalised table, designed for
reporting, and maintain it with a frequent garbo job, since the data
does not have to be immediately current.
On Wed 31 Oct 2012 23:24:23 EST, Curtis Hovey wrote:
> Review: Needs Information code
>
> Line 123 looks inconsistent because the storm column does not use ID
> SourcePackagePu
>
> The while-loop looks odd. I don't like use the done variable, but I see you wanted something separate from max_results. I don't understand what happens when max_results is None or 0 -- they seem to lead to contradictory behaviour. I suppose 0 is really a value error for max_results. What happens when max_results is None and the the last batch is returns less than the batch size? eg. rs has only 15 more items, it iterates over them, then back to the start of the loop to get the next batch using a slice that exceeds everything in the rs.

Line 123 looks inconsistent because the storm column does not use ID gePublishingHis tory.sourcepack agereleaseID
SourcePacka
The while-loop looks odd. I don't like use the done variable, but I see you wanted something separate from max_results. I don't understand what happens when max_results is None or 0 -- they seem to lead to contradictory behaviour. I suppose 0 is really a value error for max_results. What happens when max_results is None and the the last batch is returns less than the batch size? eg. rs has only 15 more items, it iterates over them, then back to the start of the loop to get the next batch using a slice that exceeds everything in the rs.