aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2018-04-10 17:21:06 +0200
committerLudovic Courtès <ludo@gnu.org>2018-04-10 17:21:06 +0200
commit238f856e48ee333ed3e19fa32ce5e1742c650c67 (patch)
treefaba105b2d02d581201feedf27b45e774af3b21a
parent43be95c40a433d21f65c9e6bfb04ccc9fa8e2db4 (diff)
downloadcuirass-238f856e48ee333ed3e19fa32ce5e1742c650c67.tar
cuirass-238f856e48ee333ed3e19fa32ce5e1742c650c67.tar.gz
database: Adjust index to speed up /api/queue queries.
* src/schema.sql: Extend 'Builds_Derivations_index' to account for /api/queue queries.
-rw-r--r--src/schema.sql4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/schema.sql b/src/schema.sql
index 8d3a651..65aebbd 100644
--- a/src/schema.sql
+++ b/src/schema.sql
@@ -61,8 +61,8 @@ CREATE TABLE Builds (
);
-- Create indexes to speed up common queries, in particular those
--- corresponding to /api/latestbuilds HTTP requests.
-CREATE INDEX Builds_Derivations_index ON Builds(status ASC, derivation, evaluation, stoptime DESC);
+-- corresponding to /api/latestbuilds and /api/queue HTTP requests.
+CREATE INDEX Builds_Derivations_index ON Builds(status ASC, timestamp ASC, id, derivation, evaluation, stoptime DESC);
CREATE INDEX Specifications_index ON Specifications(repo_name, branch);
CREATE INDEX Derivations_index ON Derivations(derivation, evaluation, job_name, system);