aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMathieu Othacehe <othacehe@gnu.org>2020-10-06 18:26:28 +0200
committerMathieu Othacehe <othacehe@gnu.org>2020-10-06 18:26:28 +0200
commit04e95afa1e47a0190752eb17541987c695ba73cd (patch)
tree5ed2670d42afbdb17666a258b99ae9b76d5158a0 /src
parentcfc7710b7f400945e0081cf84cfeebfc69777deb (diff)
downloadcuirass-04e95afa1e47a0190752eb17541987c695ba73cd.tar
cuirass-04e95afa1e47a0190752eb17541987c695ba73cd.tar.gz
Add index on builds table.
* src/sql/upgrade-14.sql: New file. * src/schema.sql (dist_sql_DATA): Add it. * src/schema.sql (Builds_timestamp_stoptime): New index.
Diffstat (limited to 'src')
-rw-r--r--src/schema.sql1
-rw-r--r--src/sql/upgrade-14.sql5
2 files changed, 6 insertions, 0 deletions
diff --git a/src/schema.sql b/src/schema.sql
index f98d430..fb71319 100644
--- a/src/schema.sql
+++ b/src/schema.sql
@@ -99,6 +99,7 @@ CREATE TABLE Events (
CREATE INDEX Builds_status_index ON Builds (status);
CREATE INDEX Builds_evaluation_index ON Builds (evaluation, status);
CREATE INDEX Builds_nix_name ON Builds (nix_name COLLATE NOCASE);
+CREATE INDEX Builds_timestamp_stoptime on Builds(timestamp, stoptime);
CREATE INDEX Evaluations_status_index ON Evaluations (id, status);
CREATE INDEX Evaluations_specification_index ON Evaluations (specification, id DESC);
CREATE INDEX Outputs_derivation_index ON Outputs (derivation);
diff --git a/src/sql/upgrade-14.sql b/src/sql/upgrade-14.sql
new file mode 100644
index 0000000..566077c
--- /dev/null
+++ b/src/sql/upgrade-14.sql
@@ -0,0 +1,5 @@
+BEGIN TRANSACTION;
+
+CREATE INDEX Builds_timestamp_stoptime on Builds(timestamp, stoptime);
+
+COMMIT;