Fix some broken indices

These indices basically did nothing since they put "id" first.

In particular this makes /job/.../all much faster.
This commit is contained in:
Eelco Dolstra
2020-10-28 14:18:20 +01:00
parent 2922f45b4f
commit 87317812a8
2 changed files with 7 additions and 2 deletions

5
src/sql/upgrade-68.sql Normal file
View File

@@ -0,0 +1,5 @@
drop index IndexBuildsOnJobsetIdFinishedId;
create index IndexBuildsOnJobsetIdFinishedId on Builds(jobset_id, job, finished, id DESC);
drop index IndexFinishedSuccessfulBuilds;
create index IndexFinishedSuccessfulBuilds on Builds(jobset_id, job, finished, buildstatus, id DESC) where buildstatus = 0 and finished = 1;