← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~cjwatson/launchpad/package-cache-indexes into lp:launchpad

 

Colin Watson has proposed merging lp:~cjwatson/launchpad/package-cache-indexes into lp:launchpad.

Commit message:
Add (xPN, archive) indexes on package cache tables.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/package-cache-indexes/+merge/296379

Add (xPN, archive) indexes on package cache tables.  This makes the upcoming changes to {Source,Binary}PackageNameVocabulary to use the package caches perform much better - a few milliseconds vs. about a second on dogfood for reasonably typical queries.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~cjwatson/launchpad/package-cache-indexes into lp:launchpad.
=== added file 'database/schema/patch-2209-78-2.sql'
--- database/schema/patch-2209-78-2.sql	1970-01-01 00:00:00 +0000
+++ database/schema/patch-2209-78-2.sql	2016-06-02 23:30:09 +0000
@@ -0,0 +1,11 @@
+-- Copyright 2016 Canonical Ltd.  This software is licensed under the
+-- GNU Affero General Public License version 3 (see the file LICENSE).
+
+SET client_min_messages=ERROR;
+
+CREATE INDEX distributionsourcepackagecache__sourcepackagename__archive__idx
+    ON DistributionSourcePackageCache (sourcepackagename, archive);
+CREATE INDEX distroseriespackagecache__binarypackagename__archive__idx
+    ON DistroSeriesPackageCache (binarypackagename, archive);
+
+INSERT INTO LaunchpadDatabaseRevision VALUES (2209, 78, 2);


Follow ups