aboutsummaryrefslogtreecommitdiff
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
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.
-rw-r--r--Makefile.am3
-rw-r--r--src/schema.sql1
-rw-r--r--src/sql/upgrade-14.sql5
3 files changed, 8 insertions, 1 deletions
diff --git a/Makefile.am b/Makefile.am
index 9f7d411..e66ff84 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -82,7 +82,8 @@ dist_sql_DATA = \
src/sql/upgrade-10.sql \
src/sql/upgrade-11.sql \
src/sql/upgrade-12.sql \
- src/sql/upgrade-13.sql
+ src/sql/upgrade-13.sql \
+ src/sql/upgrade-14.sql
dist_css_DATA = \
src/static/css/cuirass.css \
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;