← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~wgrant/launchpad/dspc-trgm-indices into lp:launchpad

 

William Grant has proposed merging lp:~wgrant/launchpad/dspc-trgm-indices into lp:launchpad.

Requested reviews:
  Stuart Bishop (stub): db
Related bugs:
  Bug #739051 in Launchpad itself: "Product:+index timeouts"
  https://bugs.launchpad.net/launchpad/+bug/739051

For more details, see:
https://code.launchpad.net/~wgrant/launchpad/dspc-trgm-indices/+merge/109995

This branch adds three indices to SourcePackagePublishingHistory and DistributionSourcePackageCache. They're all to make the new Distribution.searchSourcePackageCaches query in lp:~wgrant/launchpad/package-search-timeouts nice and fast.

The existing GiST FTI index is being replaced with a faster GIN one. name gets a trigram index so LIKE '%foo%' is fast. SPPH gets a new compound index.
-- 
https://code.launchpad.net/~wgrant/launchpad/dspc-trgm-indices/+merge/109995
Your team Launchpad code reviewers is subscribed to branch lp:launchpad.
=== added file 'database/schema/patch-2209-23-0.sql'
--- database/schema/patch-2209-23-0.sql	1970-01-01 00:00:00 +0000
+++ database/schema/patch-2209-23-0.sql	2012-06-13 08:11:25 +0000
@@ -0,0 +1,16 @@
+-- Copyright 2012 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 SCHEMA trgm;
+CREATE EXTENSION pg_trgm WITH SCHEMA trgm;
+
+CREATE INDEX distributionsourcepackagecache__name__idx
+    ON distributionsourcepackagecache USING gin (name trgm.gin_trgm_ops);
+CREATE INDEX distributionsourcepackagecache__fti__idx
+    ON distributionsourcepackagecache USING gin (fti);
+CREATE INDEX sourcepackagepublishinghistory__archive__distroseries__spn__status__idx
+    ON sourcepackagepublishinghistory (archive, distroseries, sourcepackagename, status);
+
+INSERT INTO LaunchpadDatabaseRevision VALUES (2209, 23, 0);


Follow ups