SQL: create better indexes for builds based on the jobset id
[?]
Jun 1, 2021, 3:23 PM
XKJOP4WX7J2UUXLZ2EEGRCUX6U5WD6YQBAMFIE266JBVQYC3VEIACDependencies
- [2]
YF3HTIPFUse partial indexes - [*]
N22GPKYT* Put info about logs / build products in the DB. - [*]
6QRHXIM3* Speed up the jobset index page. Especially the query to get the - [*]
D5QIOJGP* Move everything up one directory.
Change contents
- edit in src/sql/hydra.sql at line 615
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; - file addition: upgrade-75.sql[6.3004]
-- These take about 9 minutes in total on a replica of hydra.nixos.orgcreate 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;