Merge lp:~wgrant/launchpad/bug-933853 into lp:launchpad
Status: | Merged |
---|---|
Merged at revision: | 14822 |
Proposed branch: | lp:~wgrant/launchpad/bug-933853 |
Merge into: | lp:launchpad |
Diff against target: |
38 lines (+12/-8) 1 file modified
lib/lp/code/model/branchlookup.py (+12/-8) |
To merge this branch: | bzr merge lp:~wgrant/launchpad/bug-933853 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ian Booth (community) | Approve | ||
Review via email: mp+93508@code.launchpad.net |
Commit message
Tweak the query used by BranchLookup.
Description of the change
When given ~ubuntu-branches as an owner, the package branch query in BranchLookup.
00:44:22 < stub> Night. I can't improve on what you have.
00:46:47 < wgrant> stub: Thanks. I might land that tomorrow, then.
00:47:19 < stub> http://
OLD
===
SELECT Branch.id FROM Branch JOIN Person ON Branch.owner = Person.id JOIN SourcePackageName ON Branch.
Nested Loop (cost=0.00..355.15 rows=1 width=4) (actual time=1276.
-> Nested Loop (cost=0.00..354.80 rows=1 width=8) (actual time=0.
Join Filter: (distroseries.
-> Nested Loop (cost=0.00..348.35 rows=1 width=12) (actual time=0.285..643.485 rows=21398 loops=1)
-> Nested Loop (cost=0.00..348.07 rows=1 width=12) (actual time=0.250..460.098 rows=21398 loops=1)
-> Index Scan using distrorelease_pkey on distroseries (cost=0.00..0.27 rows=1 width=8) (actual time=0.004..0.005 rows=1 loops=21398)
-> Seq Scan on distribution (cost=0.00..6.44 rows=1 width=4) (actual time=0.015..0.020 rows=1 loops=21398)
-> Index Scan using sourcepackagena
Index Cond: (sourcepackagen
Filter: (sourcepackagen
Total runtime: 1364.061 ms
NEW
===
SELECT Branch.id FROM Branch JOIN Person ON Branch.owner = Person.id JOIN SourcePackageName ON Branch.
Nested Loop (cost=10.07..34.71 rows=1 width=820) (actual time=0.171..0.180 rows=1 loops=1)
InitPlan 1 (returns $0)
-> Nested Loop (cost=0.00..10.07 rows=1 width=4) (actual time=0.066..0.088 rows=1 loops=1)
Join Filter: (distribution.id = distroseries.
-> Seq Scan on distribution (cost=0.00..6.44 rows=1 width=4) (actual time=0.035..0.042 rows=1 loops=1)
-> Seq Scan on distroseries (cost=0.00..3.60 rows=3 width=8) (actual time=0.010..0.037 rows=3 loops=1)
-> Nested Loop (cost=0.00..16.69 rows=1 width=820) (actual time=0.149..0.153 rows=1 loops=1)
-> Index Scan using sourcepackagena
-> Index Scan using branch_
-> Index Scan using person_pkey on person (cost=0.00..7.94 rows=1 width=4) (actual time=0.018..0.020 rows=1 loops=1)
Index Cond: (person.id = branch.owner)
Filter: (person.name = 'ubuntu-
Total runtime: 0.381 ms
Very nice.