aboutsummaryrefslogtreecommitdiff
path: root/sqitch
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2020-05-10 18:27:56 +0100
committerChristopher Baines <mail@cbaines.net>2020-05-10 18:27:56 +0100
commitbd7e7e76803a6c9d85a392c321839f83160d20f8 (patch)
treeed460474992fb177da67520b4d154bbeb5e238fb /sqitch
parent78ed59c7292d57906f0539d7e2df5962dcb45d38 (diff)
downloadbuild-coordinator-bd7e7e76803a6c9d85a392c321839f83160d20f8.tar
build-coordinator-bd7e7e76803a6c9d85a392c321839f83160d20f8.tar.gz
Replace datastore-fetch-input-builds-for-unprocessed-builds
It worked under some database conditions, but was very slow under others. Move more of the logic in to SQL in an attempt to make the allocator faster. This sort of works, but there were some advantages to the approach before the approach being replaced in this commit.
Diffstat (limited to 'sqitch')
-rw-r--r--sqitch/pg/deploy/build_results_result_index.sql7
-rw-r--r--sqitch/pg/revert/build_results_result_index.sql7
-rw-r--r--sqitch/pg/verify/build_results_result_index.sql7
-rw-r--r--sqitch/sqitch.plan1
-rw-r--r--sqitch/sqlite/deploy/build_results_result_index.sql7
-rw-r--r--sqitch/sqlite/revert/build_results_result_index.sql7
-rw-r--r--sqitch/sqlite/verify/build_results_result_index.sql7
7 files changed, 43 insertions, 0 deletions
diff --git a/sqitch/pg/deploy/build_results_result_index.sql b/sqitch/pg/deploy/build_results_result_index.sql
new file mode 100644
index 0000000..aa1030e
--- /dev/null
+++ b/sqitch/pg/deploy/build_results_result_index.sql
@@ -0,0 +1,7 @@
+-- Deploy guix-build-coordinator:build_results_result_index to pg
+
+BEGIN;
+
+-- XXX Add DDLs here.
+
+COMMIT;
diff --git a/sqitch/pg/revert/build_results_result_index.sql b/sqitch/pg/revert/build_results_result_index.sql
new file mode 100644
index 0000000..f92fd22
--- /dev/null
+++ b/sqitch/pg/revert/build_results_result_index.sql
@@ -0,0 +1,7 @@
+-- Revert guix-build-coordinator:build_results_result_index from pg
+
+BEGIN;
+
+-- XXX Add DDLs here.
+
+COMMIT;
diff --git a/sqitch/pg/verify/build_results_result_index.sql b/sqitch/pg/verify/build_results_result_index.sql
new file mode 100644
index 0000000..1c19fd1
--- /dev/null
+++ b/sqitch/pg/verify/build_results_result_index.sql
@@ -0,0 +1,7 @@
+-- Verify guix-build-coordinator:build_results_result_index on pg
+
+BEGIN;
+
+-- XXX Add verifications here.
+
+ROLLBACK;
diff --git a/sqitch/sqitch.plan b/sqitch/sqitch.plan
index 509802d..20d36dc 100644
--- a/sqitch/sqitch.plan
+++ b/sqitch/sqitch.plan
@@ -13,3 +13,4 @@ derivation_outputs_output_index 2020-04-28T17:49:19Z Christopher Baines <mail@cb
allocator_related_indexes 2020-04-29T16:59:14Z Christopher Baines <mail@cbaines.net> # Add a few indexes that should speed up build allocation
unprocessed_hook_events 2020-05-08T12:55:28Z Christopher Baines <mail@cbaines.net> # Add a new table unprocessed_hook_events
derivation_outputs_derivation_name_index 2020-05-10T16:24:05Z Christopher Baines <mail@cbaines.net> # Add an index on derivation_outputs.derivation_name
+build_results_result_index 2020-05-10T17:27:00Z Christopher Baines <mail@cbaines.net> # Add an index on build_results.result
diff --git a/sqitch/sqlite/deploy/build_results_result_index.sql b/sqitch/sqlite/deploy/build_results_result_index.sql
new file mode 100644
index 0000000..00dfe33
--- /dev/null
+++ b/sqitch/sqlite/deploy/build_results_result_index.sql
@@ -0,0 +1,7 @@
+-- Deploy guix-build-coordinator:build_results_result_index to sqlite
+
+BEGIN;
+
+CREATE INDEX build_results_result_idx ON build_results (result);
+
+COMMIT;
diff --git a/sqitch/sqlite/revert/build_results_result_index.sql b/sqitch/sqlite/revert/build_results_result_index.sql
new file mode 100644
index 0000000..01f8287
--- /dev/null
+++ b/sqitch/sqlite/revert/build_results_result_index.sql
@@ -0,0 +1,7 @@
+-- Revert guix-build-coordinator:build_results_result_index from sqlite
+
+BEGIN;
+
+-- XXX Add DDLs here.
+
+COMMIT;
diff --git a/sqitch/sqlite/verify/build_results_result_index.sql b/sqitch/sqlite/verify/build_results_result_index.sql
new file mode 100644
index 0000000..40bbbe6
--- /dev/null
+++ b/sqitch/sqlite/verify/build_results_result_index.sql
@@ -0,0 +1,7 @@
+-- Verify guix-build-coordinator:build_results_result_index on sqlite
+
+BEGIN;
+
+-- XXX Add verifications here.
+
+ROLLBACK;