Merge lp:~stevenk/launchpad/index-previewdiff-merge_proposal into lp:launchpad

Proposed by Steve Kowalik
Status: Merged
Approved by: William Grant
Approved revision: no longer in the source branch.
Merged at revision: 16621
Proposed branch: lp:~stevenk/launchpad/index-previewdiff-merge_proposal
Merge into: lp:launchpad
Prerequisite: lp:~stevenk/launchpad/drop-previewdiff-garbo
Diff against target: 13 lines (+9/-0)
1 file modified
database/schema/patch-2209-44-1.sql (+9/-0)
To merge this branch: bzr merge lp:~stevenk/launchpad/index-previewdiff-merge_proposal
Reviewer Review Type Date Requested Status
William Grant db Approve
Review via email: mp+162915@code.launchpad.net

Commit message

Add an index across PreviewDiff.{branch_merge_proposal,date_created}.

Description of the change

Add an index onto PreviewDiff.merge_propsosal and set it to not null now that it is populated.

To post a comment you must log in.
Revision history for this message
William Grant (wgrant) wrote :

This should be a compound index so it can also be used for the sort in https://code.launchpad.net/~stevenk/launchpad/switch-bmp-to-previewdiff-merge_proposal/+merge/162916.

review: Needs Fixing (db)
Revision history for this message
William Grant (wgrant) :
review: Approve (code)
Revision history for this message
William Grant (wgrant) wrote :

The index needs to be applied live, while the NOT NULL cannot be. I'd move the NOT NULLs to the cold patch, lp:~stevenk/launchpad/drop-branchmergeproposal-merge_diff.

(Ignore the previous code vote; wrong MP.)

review: Needs Fixing (db)
Revision history for this message
William Grant (wgrant) :
review: Approve (code)
Revision history for this message
William Grant (wgrant) :
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-44-1.sql'
2--- database/schema/patch-2209-44-1.sql 1970-01-01 00:00:00 +0000
3+++ database/schema/patch-2209-44-1.sql 2013-05-13 06:57:29 +0000
4@@ -0,0 +1,9 @@
5+-- Copyright 2013 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 UNIQUE INDEX previewdiff__branch_merge_proposal__date_created__key
11+ ON previewdiff (branch_merge_proposal, date_created);
12+
13+INSERT INTO LaunchpadDatabaseRevision VALUES (2209, 44, 1);