Merge lp:~stevenk/launchpad/spph-packageupload-index into lp:launchpad

Proposed by Steve Kowalik on 2012-06-04
Status: Merged
Approved by: Steve Kowalik on 2012-06-05
Approved revision: no longer in the source branch.
Merged at revision: 15360
Proposed branch: lp:~stevenk/launchpad/spph-packageupload-index
Merge into: lp:launchpad
Diff against target: 12 lines (+8/-0)
1 file modified
database/schema/patch-2209-15-3.sql (+8/-0)
To merge this branch: bzr merge lp:~stevenk/launchpad/spph-packageupload-index
Reviewer Review Type Date Requested Status
Stuart Bishop db 2012-06-04 Approve on 2012-06-05
Robert Collins db 2012-06-04 Pending
Review via email: mp+108515@code.launchpad.net

Commit Message

Add an index on SourcePackagePublishingHistory.packageupload.

Description of the Change

Add an index on SourcePackagePublishingHistory.packageupload to allow the garbo job in https://code.launchpad.net/~stevenk/launchpad/set-spph-packageupload/+merge/108513 to run faster than glacially.

To post a comment you must log in.
Stuart Bishop (stub) wrote :

The WHERE clause should be IS NOT NULL, not IS NULL.

Otherwise fine.

review: Approve (db)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'database/schema/patch-2209-15-3.sql'
2--- database/schema/patch-2209-15-3.sql 1970-01-01 00:00:00 +0000
3+++ database/schema/patch-2209-15-3.sql 2012-06-05 08:29:23 +0000
4@@ -0,0 +1,8 @@
5+-- Copyright 2012 Canonical Ltd. This software is licensed under the
6+-- GNU Affero General Public License version 3 (see the file LICENSE).
7+
8+SET client_min_messages=ERROR;
9+
10+CREATE INDEX sourcepackagepublishinghistory__packageupload__idx ON sourcepackagepublishinghistory USING btree (id) WHERE packageupload IS NOT NULL;
11+
12+INSERT INTO LaunchpadDatabaseRevision VALUES (2209, 15, 3);