SQL: create better indexes for builds based on the jobset id
These are primarily used by the jobsetOverview renders.
This commit is contained in:
parent
719d0a6134
commit
a9e4ede006
|
@ -612,6 +612,9 @@ create index IndexBuildsOnFinished on Builds(finished) where finished = 0;
|
|||
create index IndexBuildsOnIsCurrent on Builds(isCurrent) where isCurrent = 1;
|
||||
create index IndexBuildsOnJobsetIsCurrent on Builds(project, jobset, isCurrent) where isCurrent = 1;
|
||||
create index IndexBuildsOnJobIsCurrent on Builds(project, jobset, job, isCurrent) where isCurrent = 1;
|
||||
create index IndexBuildsJobsetIdCurrentUnfinished on Builds(jobset_id) where isCurrent = 1 and finished = 0;
|
||||
create index IndexBuildsJobsetIdCurrentFinishedStatus on Builds(jobset_id, buildstatus) where isCurrent = 1 and finished = 1;
|
||||
create index IndexBuildsJobsetIdCurrent on Builds(jobset_id) where isCurrent = 1;
|
||||
create index IndexBuildsOnJobset on Builds(project, jobset);
|
||||
create index IndexBuildsOnProject on Builds(project);
|
||||
create index IndexBuildsOnTimestamp on Builds(timestamp);
|
||||
|
|
5
src/sql/upgrade-75.sql
Normal file
5
src/sql/upgrade-75.sql
Normal file
|
@ -0,0 +1,5 @@
|
|||
-- These take about 9 minutes in total on a replica of hydra.nixos.org
|
||||
|
||||
create index IndexBuildsJobsetIdCurrentUnfinished on Builds(jobset_id) where isCurrent = 1 and finished = 0;
|
||||
create index IndexBuildsJobsetIdCurrentFinishedStatus on Builds(jobset_id, buildstatus) where isCurrent = 1 and finished = 1;
|
||||
create index IndexBuildsJobsetIdCurrent on Builds(jobset_id) where isCurrent = 1;
|
Loading…
Reference in a new issue