1 | -- $Id: tmdb-r15-index-sorting.pgsql 76553 2019-01-01 01:45:53Z vboxsync $
|
---|
2 | --- @file
|
---|
3 | -- VBox Test Manager Database - Index tuning effort.
|
---|
4 | --
|
---|
5 |
|
---|
6 | --
|
---|
7 | -- Copyright (C) 2015-2019 Oracle Corporation
|
---|
8 | --
|
---|
9 | -- This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | -- available from http://www.virtualbox.org. This file is free software;
|
---|
11 | -- you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | -- General Public License (GPL) as published by the Free Software
|
---|
13 | -- Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | -- VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | -- hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | --
|
---|
17 | -- The contents of this file may alternatively be used under the terms
|
---|
18 | -- of the Common Development and Distribution License Version 1.0
|
---|
19 | -- (CDDL) only, as it comes in the "COPYING.CDDL" file of the
|
---|
20 | -- VirtualBox OSE distribution, in which case the provisions of the
|
---|
21 | -- CDDL are applicable instead of those of the GPL.
|
---|
22 | --
|
---|
23 | -- You may elect to license modified versions of this file under the
|
---|
24 | -- terms and conditions of either the GPL or the CDDL or both.
|
---|
25 | --
|
---|
26 |
|
---|
27 |
|
---|
28 | --
|
---|
29 | -- Reordered, modified and new indexes.
|
---|
30 | --
|
---|
31 | \d UsersLoginNameIdx;
|
---|
32 | DROP INDEX UsersLoginNameIdx;
|
---|
33 | CREATE INDEX UsersLoginNameIdx ON Users (sLoginName, tsExpire DESC);
|
---|
34 | \d UsersLoginNameIdx;
|
---|
35 | ANALYZE VERBOSE Users;
|
---|
36 |
|
---|
37 |
|
---|
38 | \d TestCaseArgsLookupIdx;
|
---|
39 | DROP INDEX TestCaseArgsLookupIdx;
|
---|
40 | CREATE INDEX TestCaseArgsLookupIdx ON TestCaseArgs (idTestCase, tsExpire DESC, tsEffective ASC);
|
---|
41 | \d TestCaseArgsLookupIdx;
|
---|
42 | ANALYZE VERBOSE TestCaseArgs;
|
---|
43 |
|
---|
44 |
|
---|
45 | \d TestGroups_id_index;
|
---|
46 | DROP INDEX TestGroups_id_index;
|
---|
47 | CREATE INDEX TestGroups_id_index ON TestGroups (idTestGroup, tsExpire DESC, tsEffective ASC);
|
---|
48 | \d TestGroups_id_index;
|
---|
49 | ANALYZE VERBOSE TestGroups;
|
---|
50 |
|
---|
51 |
|
---|
52 | \d TestBoxesUuidIdx;
|
---|
53 | DROP INDEX TestBoxesUuidIdx;
|
---|
54 | CREATE UNIQUE INDEX TestBoxesUuidIdx ON TestBoxes (uuidSystem, tsExpire DESC);
|
---|
55 | \d TestBoxesUuidIdx;
|
---|
56 | DROP INDEX IF EXISTS TestBoxesExpireEffectiveIdx;
|
---|
57 | CREATE INDEX TestBoxesExpireEffectiveIdx ON TestBoxes (tsExpire DESC, tsEffective ASC);
|
---|
58 | \d TestBoxesExpireEffectiveIdx;
|
---|
59 | ANALYZE VERBOSE TestBoxes;
|
---|
60 |
|
---|
61 |
|
---|
62 | DROP INDEX IF EXISTS BuildBlacklistIdx;
|
---|
63 | CREATE INDEX BuildBlacklistIdx ON BuildBlacklist (iLastRevision DESC, iFirstRevision ASC, sProduct, sBranch,
|
---|
64 | tsExpire DESC, tsEffective ASC);
|
---|
65 | \d BuildBlacklist;
|
---|
66 | ANALYZE VERBOSE BuildBlacklist;
|
---|
67 |
|
---|
68 |
|
---|
69 | \d TestResultsNameIdx;
|
---|
70 | DROP INDEX TestResultsNameIdx;
|
---|
71 | CREATE INDEX TestResultsNameIdx ON TestResults (idStrName, tsCreated DESC);
|
---|
72 | \d TestResultsNameIdx;
|
---|
73 | DROP INDEX IF EXISTS TestResultsNameIdx2;
|
---|
74 | CREATE INDEX TestResultsNameIdx2 ON TestResults (idTestResult, idStrName);
|
---|
75 | \d TestResultsNameIdx2;
|
---|
76 | ANALYZE VERBOSE TestResults;
|
---|
77 |
|
---|
78 |
|
---|
79 | \d TestSetsCreatedDoneIdx;
|
---|
80 | DROP INDEX TestSetsCreatedDoneIdx;
|
---|
81 | DROP INDEX IF EXISTS TestSetsDoneCreatedBuildCatIdx;
|
---|
82 | CREATE INDEX TestSetsDoneCreatedBuildCatIdx ON TestSets (tsDone DESC NULLS FIRST, tsCreated ASC, idBuildCategory);
|
---|
83 | \d TestSetsDoneCreatedBuildCatIdx;
|
---|
84 | \d TestSetsGraphBoxIdx;
|
---|
85 | DROP INDEX TestSetsGraphBoxIdx;
|
---|
86 | CREATE INDEX TestSetsGraphBoxIdx ON TestSets (idTestBox, tsCreated DESC, tsDone ASC NULLS LAST, idBuildCategory, idTestCase);
|
---|
87 | \d TestSetsGraphBoxIdx;
|
---|
88 | ANALYZE VERBOSE TestSets;
|
---|
89 |
|
---|
90 |
|
---|
91 | DROP INDEX IF EXISTS SchedQueuesItemIdx;
|
---|
92 | CREATE INDEX SchedQueuesItemIdx ON SchedQueues(idItem);
|
---|
93 | \d SchedQueuesItemIdx;
|
---|
94 | DROP INDEX IF EXISTS SchedQueuesSchedGroupIdx;
|
---|
95 | CREATE INDEX SchedQueuesSchedGroupIdx ON SchedQueues(idSchedGroup);
|
---|
96 | \d SchedQueuesSchedGroupIdx;
|
---|
97 | ANALYZE VERBOSE SchedQueues;
|
---|
98 |
|
---|