Merge lp:~julian-edwards/launchpad/slow-ppa-search-bug-659129 into lp:launchpad/db-devel

Proposed by Julian Edwards
Status: Merged
Approved by: Gavin Panella
Approved revision: no longer in the source branch.
Merged at revision: 9890
Proposed branch: lp:~julian-edwards/launchpad/slow-ppa-search-bug-659129
Merge into: lp:launchpad/db-devel
Diff against target: 11 lines (+1/-1)
1 file modified
lib/lp/registry/model/distribution.py (+1/-1)
To merge this branch: bzr merge lp:~julian-edwards/launchpad/slow-ppa-search-bug-659129
Reviewer Review Type Date Requested Status
Gavin Panella (community) Approve
Graham Binns (community) code Approve
Robert Collins (community) release-critical Approve
Review via email: mp+38307@code.launchpad.net

Commit message

Prevent the /ubuntu/+ppas page from timing out by fixing a slow query that PG8.4 hates.

Description of the change

See the bug, but in a nutshell:

Removes the DISTINCT clause from the slow query as per stub's suggestion in the bug.

To post a comment you must log in.
Revision history for this message
Robert Collins (lifeless) :
review: Approve (release-critical)
Revision history for this message
Graham Binns (gmb) :
review: Approve (code)
Revision history for this message
Julian Edwards (julian-edwards) wrote :

Since it's not updating the diff with the new changes, here it is:

=== modified file 'lib/lp/registry/model/distribution.py'
--- lib/lp/registry/model/distribution.py 2010-10-13 09:17:14 +0000
+++ lib/lp/registry/model/distribution.py 2010-10-14 10:16:50 +0000
@@ -1442,12 +1442,11 @@
1442 clauses = ["""1442 clauses = ["""
1443 Archive.purpose = %s AND1443 Archive.purpose = %s AND
1444 Archive.distribution = %s AND1444 Archive.distribution = %s AND
1445 Person.id = Archive.owner AND1445 Archive.owner = ValidPersonOrTeamCache.id
1446 Person.id = ValidPersonOrTeamCache.id
1447 """ % sqlvalues(ArchivePurpose.PPA, self)]1446 """ % sqlvalues(ArchivePurpose.PPA, self)]
14481447
1449 clauseTables = ['Person', 'ValidPersonOrTeamCache']1448 clauseTables = ['ValidPersonOrTeamCache']
1450 orderBy = ['Person.name']1449 orderBy = ['Archive.displayname']
14511450
1452 if not show_inactive:1451 if not show_inactive:
1453 active_statuses = (PackagePublishingStatus.PUBLISHED,1452 active_statuses = (PackagePublishingStatus.PUBLISHED,
14541453
=== modified file 'lib/lp/soyuz/stories/ppa/xx-private-ppas.txt'
--- lib/lp/soyuz/stories/ppa/xx-private-ppas.txt 2010-02-24 15:59:22 +0000
+++ lib/lp/soyuz/stories/ppa/xx-private-ppas.txt 2010-10-14 10:28:00 +0000
@@ -49,10 +49,10 @@
49 >>> cprov_browser.getControl(name="show_inactive").value = True49 >>> cprov_browser.getControl(name="show_inactive").value = True
50 >>> cprov_browser.getControl('Search', index=0).click()50 >>> cprov_browser.getControl('Search', index=0).click()
51 >>> list_ppas_in_browser_page(cprov_browser)51 >>> list_ppas_in_browser_page(cprov_browser)
52 PPA for Celso Providelo...
53 PPA for Mark Shuttleworth...
54 PPA for No Privileges Person...
52 PPA named p3a for Celso Providelo...55 PPA named p3a for Celso Providelo...
53 PPA for Celso Providelo...
54 PPA for Mark Shuttleworth...
55 PPA for No Privileges Person...
5656
57Let's make a new team PPA for "landscape-developers" and make it57Let's make a new team PPA for "landscape-developers" and make it
58private.58private.
Revision history for this message
Gavin Panella (allenap) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lib/lp/registry/model/distribution.py'
--- lib/lp/registry/model/distribution.py 2010-10-04 20:46:55 +0000
+++ lib/lp/registry/model/distribution.py 2010-10-13 09:28:58 +0000
@@ -1454,7 +1454,7 @@
1454 PackagePublishingStatus.PENDING)1454 PackagePublishingStatus.PENDING)
1455 clauses.append("""1455 clauses.append("""
1456 Archive.id IN (1456 Archive.id IN (
1457 SELECT DISTINCT archive FROM SourcepackagePublishingHistory1457 SELECT archive FROM SourcepackagePublishingHistory
1458 WHERE status IN %s)1458 WHERE status IN %s)
1459 """ % sqlvalues(active_statuses))1459 """ % sqlvalues(active_statuses))
14601460

Subscribers

People subscribed via source and target branches

to status/vote changes: