Merge lp:~wgrant/launchpad/bug-899776-index into lp:launchpad

Proposed by William Grant
Status: Merged
Merged at revision: 15167
Proposed branch: lp:~wgrant/launchpad/bug-899776-index
Merge into: lp:launchpad
Diff against target: 16 lines (+12/-0)
1 file modified
database/schema/patch-2209-16-2.sql (+12/-0)
To merge this branch: bzr merge lp:~wgrant/launchpad/bug-899776-index
Reviewer Review Type Date Requested Status
Stuart Bishop (community) db Approve
Review via email: mp+103821@code.launchpad.net

Commit message

Add an index on SourcePackagePublishingHistory to accelerate bug package component search.

Description of the change

The changes in https://code.launchpad.net/~wgrant/launchpad/bug-899776/+merge/103806 rely on a new index in order to be really fast. https://pastebin.canonical.com/65104/ is the query and plan from dogfood, with this index as temp_spph.

To post a comment you must log in.
Revision history for this message
Stuart Bishop (stub) :
review: Approve (db)
Revision history for this message
Stuart Bishop (stub) wrote :

Applied on staging and qastaging

Revision history for this message
Stuart Bishop (stub) wrote :

Applied on production slaves

Revision history for this message
Stuart Bishop (stub) wrote :

And production master. Now applied everywhere.

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-16-2.sql'
2--- database/schema/patch-2209-16-2.sql 1970-01-01 00:00:00 +0000
3+++ database/schema/patch-2209-16-2.sql 2012-04-27 07:39:46 +0000
4@@ -0,0 +1,12 @@
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
11+ sourcepackagepublishinghistory__archive__distroseries__component__spn__idx
12+ ON sourcepackagepublishinghistory
13+ USING btree (archive, distroseries, component, sourcepackagename)
14+ WHERE status IN (1, 2);
15+
16+INSERT INTO LaunchpadDatabaseRevision VALUES (2209, 16, 2);