Merge lp:~wgrant/launchpad/sharing-prettier-sql into lp:launchpad
| Status: | Merged |
|---|---|
| Approved by: | William Grant on 2012-03-23 |
| Approved revision: | no longer in the source branch. |
| Merged at revision: | 15002 |
| Proposed branch: | lp:~wgrant/launchpad/sharing-prettier-sql |
| Merge into: | lp:launchpad |
| Diff against target: |
273 lines (+82/-67) 4 files modified
lib/lp/registry/model/accesspolicy.py (+34/-33) lib/lp/registry/services/sharingservice.py (+10/-15) lib/lp/registry/services/tests/test_sharingservice.py (+15/-13) lib/lp/registry/tests/test_accesspolicy.py (+23/-6) |
| To merge this branch: | bzr merge lp:~wgrant/launchpad/sharing-prettier-sql |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Ian Booth (community) | 2012-03-23 | Approve on 2012-03-23 | |
|
Review via email:
|
|||
Commit Message
Rework findGranteePerm
Description of the Change
This branch reworks findGranteePerm
Currently the primary query sorts the people then eliminates duplicates. But people often have tens or even thousands of rows, so we save a lot of time by doing uniqueness first. I moved the distinct into a subquery to ensure this, and for Ubuntu it's roughly 4x faster on DF than the old query on qastaging.
Batches derived from the method's output usually have less than the desired number of rows. This is because the UI slices by person, but the method slices by (person, policy), so people with more than one policy will cause fewer people to be returned. I reworked findGranteePerm

Looks good.