launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #17883
[Merge] lp:~wgrant/launchpad/bug-1422562-index into lp:launchpad
William Grant has proposed merging lp:~wgrant/launchpad/bug-1422562-index into lp:launchpad.
Commit message:
Index BuildQueue(status, lastscore DESC, id) for _findBuildCandidate.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~wgrant/launchpad/bug-1422562-index/+merge/249919
Index BuildQueue(status, lastscore DESC, id) for _findBuildCandidate.
The existing BuildQueue(status, virtualized, processor, lastscore DESC, id)
is ideal for the query in question, but PostgreSQL 9.3 refuses to use it
for the sort if virtualized or processor are included, even in a very
simple query, and even with enable_sort=false.
Already cowboyed on production.
--
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~wgrant/launchpad/bug-1422562-index into lp:launchpad.
=== added file 'database/schema/patch-2209-62-0.sql'
--- database/schema/patch-2209-62-0.sql 1970-01-01 00:00:00 +0000
+++ database/schema/patch-2209-62-0.sql 2015-02-17 05:35:44 +0000
@@ -0,0 +1,9 @@
+-- Copyright 2015 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 buildqueue__status__lastscore__id__idx ON
+ buildqueue (status, lastscore DESC, id);
+
+INSERT INTO LaunchpadDatabaseRevision VALUES (2209, 62, 0);
Follow ups