Merge lp:~cjwatson/launchpad/more-job-indexes into lp:launchpad

Proposed by Colin Watson
Status: Merged
Merged at revision: 18960
Proposed branch: lp:~cjwatson/launchpad/more-job-indexes
Merge into: lp:launchpad
Diff against target: 13 lines (+9/-0)
1 file modified
database/schema/patch-2210-01-1.sql (+9/-0)
To merge this branch: bzr merge lp:~cjwatson/launchpad/more-job-indexes
Reviewer Review Type Date Requested Status
William Grant db Approve
Stuart Bishop db Pending
Review via email: mp+367063@code.launchpad.net

Commit message

Index ProductJob(job) and SnapBuild(build_request), as otherwise we incur full table scans when deleting Job rows.

Description of the change

This should be applied live, using CONCURRENTLY.

To post a comment you must log in.
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-2210-01-1.sql'
2--- database/schema/patch-2210-01-1.sql 1970-01-01 00:00:00 +0000
3+++ database/schema/patch-2210-01-1.sql 2019-05-07 16:00:13 +0000
4@@ -0,0 +1,9 @@
5+-- Copyright 2019 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 productjob__job__key ON ProductJob (job);
11+CREATE INDEX snapbuild__build_request__idx ON SnapBuild (build_request);
12+
13+INSERT INTO LaunchpadDatabaseRevision VALUES (2210, 01, 1);