Colin Watson has proposed merging 
lp:~cjwatson/launchpad/db-recipe-build-ordering into lp:launchpad/db-devel.

Commit message:
Add NULLS LAST to SourcePackageRecipe.*builds indexes.

Requested reviews:
  Stuart Bishop (stub): db
  Launchpad code reviewers (launchpad-reviewers): db
Related bugs:
  Bug #746140 in Launchpad itself: "Recipe superseded source builds get stuck 
at top of recent builds list forever"
  https://bugs.launchpad.net/launchpad/+bug/746140

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/db-recipe-build-ordering/+merge/340535

This goes with 
https://code.launchpad.net/~cjwatson/launchpad/recipe-build-ordering/+merge/340534.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of 
lp:~cjwatson/launchpad/db-recipe-build-ordering into lp:launchpad/db-devel.
=== added file 'database/schema/patch-2209-73-1.sql'
--- database/schema/patch-2209-73-1.sql	1970-01-01 00:00:00 +0000
+++ database/schema/patch-2209-73-1.sql	2018-03-02 18:02:42 +0000
@@ -0,0 +1,18 @@
+-- Copyright 2018 Canonical Ltd.  This software is licensed under the
+-- GNU Affero General Public License version 3 (see the file LICENSE).
+
+SET client_min_messages=ERROR;
+
+DROP INDEX sourcepackagerecipebuild__recipe__started__finished__created__idx;
+DROP INDEX sourcepackagerecipebuild__recipe__started__finished__idx;
+
+CREATE INDEX sourcepackagerecipebuild__recipe__started__finished__created__idx
+    ON SourcePackageRecipeBuild (
+        recipe, GREATEST(date_started, date_finished) DESC NULLS LAST,
+        date_created DESC, id DESC);
+CREATE INDEX sourcepackagerecipebuild__recipe__started__finished__idx
+    ON SourcePackageRecipeBuild (
+        recipe, GREATEST(date_started, date_finished) DESC NULLS LAST,
+        id DESC);
+
+INSERT INTO LaunchpadDatabaseRevision VALUES (2209, 73, 1);

_______________________________________________
Mailing list: https://launchpad.net/~launchpad-reviewers
Post to     : launchpad-reviewers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~launchpad-reviewers
More help   : https://help.launchpad.net/ListHelp

Reply via email to