Builds: index literally what latest-finished queries

[?]
Feb 9, 2020, 8:48 PM
OT4YGU4Q2ADFH372RUWU7FJCNOSKPGEBIFZQ5ZGABUSAHTDDTLCAC

Dependencies

  • [2] APURLT2Q Revert "Apply IndexBuildsOnJobFinishedId to unfinished builds only"
  • [*] N22GPKYT * Put info about logs / build products in the DB.
  • [*] C5W3WZ3Y * Index the Builds table on drvPath to prevent a full table scan
  • [*] D5QIOJGP * Move everything up one directory.

Change contents

  • edit in src/sql/hydra.sql at line 685
    [2.100]
    [5.0]
    create index IndexFinishedSuccessfulBuilds on Builds(id DESC, buildstatus, finished, job, jobset_id) where buildstatus = 0 and finished = 1;
  • file addition: upgrade-65.sql (----------)
    [6.3004]
    -- Index more exactly what the latest-finished query looks for.
    create index IndexFinishedSuccessfulBuilds
    on Builds(id DESC, buildstatus, finished, job, jobset_id)
    where buildstatus = 0 and finished = 1;