Merge lp:~wgrant/launchpad/flatten-bfj-6.5-db-more-indices into lp:launchpad

Proposed by William Grant
Status: Merged
Approved by: William Grant
Approved revision: no longer in the source branch.
Merged at revision: 16484
Proposed branch: lp:~wgrant/launchpad/flatten-bfj-6.5-db-more-indices
Merge into: lp:launchpad
Diff against target: 58 lines (+54/-0)
1 file modified
database/schema/patch-2209-41-4.sql (+54/-0)
To merge this branch: bzr merge lp:~wgrant/launchpad/flatten-bfj-6.5-db-more-indices
Reviewer Review Type Date Requested Status
William Grant db Approve
Review via email: mp+147018@code.launchpad.net

Commit message

Add D/DS/DAS:+builds, BPB.estimateDuration and SPN BPB search indices.

Description of the change

Add D/DS/DAS:+builds, BPB.estimateDuration and SPN BPB search indices.

To post a comment you must log in.
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
=== added file 'database/schema/patch-2209-41-4.sql'
--- database/schema/patch-2209-41-4.sql 1970-01-01 00:00:00 +0000
+++ database/schema/patch-2209-41-4.sql 2013-02-07 05:09:24 +0000
@@ -0,0 +1,54 @@
1-- Copyright 2013 Canonical Ltd. This software is licensed under the
2-- GNU Affero General Public License version 3 (see the file LICENSE).
3
4SET client_min_messages=ERROR;
5
6-- Distribution:+builds
7CREATE INDEX binarypackagebuild__distro__status__date_finished__id__idx
8 ON binarypackagebuild (distribution, status, date_finished DESC, id)
9 WHERE is_distro_archive;
10CREATE INDEX binarypackagebuild__distro__status__id__idx
11 ON binarypackagebuild (distribution, status, id)
12 WHERE is_distro_archive;
13CREATE INDEX binarypackagebuild__distro__id__idx
14 ON binarypackagebuild (distribution, id)
15 WHERE is_distro_archive;
16
17-- DistroSeries:+builds
18CREATE INDEX binarypackagebuild__ds__status__date_finished__id__idx
19 ON binarypackagebuild (distro_series, status, date_finished DESC, id)
20 WHERE is_distro_archive;
21CREATE INDEX binarypackagebuild__ds__status__id__idx
22 ON binarypackagebuild (distro_series, status, id)
23 WHERE is_distro_archive;
24CREATE INDEX binarypackagebuild__ds__id__idx
25 ON binarypackagebuild (distro_series, id)
26 WHERE is_distro_archive;
27
28-- DistroArchSeries:+builds
29CREATE INDEX binarypackagebuild__das__status__date_finished__id__2__idx
30 ON binarypackagebuild (distro_arch_series, status, date_finished DESC, id)
31 WHERE is_distro_archive;
32CREATE INDEX binarypackagebuild__das__status__id__2__idx
33 ON binarypackagebuild (distro_arch_series, status, id)
34 WHERE is_distro_archive;
35CREATE INDEX binarypackagebuild__das__id__2__idx
36 ON binarypackagebuild (distro_arch_series, id)
37 WHERE is_distro_archive;
38
39-- BinaryPackageBuild.estimateDuration, and general (archive, DAS) queries.
40CREATE INDEX binarypackagebuild__archive__das__spn__status__finished__idx
41 ON binarypackagebuild (archive, distro_arch_series, source_package_name,
42 status, date_finished, id);
43
44-- General queries by SPN.
45CREATE INDEX binarypackagebuild__source_package_name__idx
46 ON binarypackagebuild (source_package_name);
47
48-- And grabbing BPRs/SPRs by (name, version).
49CREATE INDEX binarypackagerelease__binarypackagename__version__idx
50 ON binarypackagerelease (binarypackagename, version);
51CREATE INDEX sourcepackagerelease__sourcepackagename__version__idx
52 ON sourcepackagerelease (sourcepackagename, version);
53
54INSERT INTO LaunchpadDatabaseRevision VALUES (2209, 41, 4);