aboutsummaryrefslogtreecommitdiff
path: root/sqitch
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2022-11-12 10:42:04 +0000
committerChristopher Baines <mail@cbaines.net>2022-11-12 10:42:04 +0000
commitfc5f562731bc32fe53ccc4f913f697a63a093fdc (patch)
treeb6ce03b5dae9536195f954a70e556ba3c9b120e6 /sqitch
parentfb9d99a076ac3b4211f6dd96e125ee8d5d1477ef (diff)
downloaddata-service-fc5f562731bc32fe53ccc4f913f697a63a093fdc.tar
data-service-fc5f562731bc32fe53ccc4f913f697a63a093fdc.tar.gz
Add index on derivation_outputs id and derivation_id fields
This might help with doing recursive queries on the derivations graph.
Diffstat (limited to 'sqitch')
-rw-r--r--sqitch/deploy/derivation_outputs_id_and_derivation_id_idx.sql7
-rw-r--r--sqitch/revert/derivation_outputs_id_and_derivation_id_idx.sql7
-rw-r--r--sqitch/sqitch.plan1
-rw-r--r--sqitch/verify/derivation_outputs_id_and_derivation_id_idx.sql7
4 files changed, 22 insertions, 0 deletions
diff --git a/sqitch/deploy/derivation_outputs_id_and_derivation_id_idx.sql b/sqitch/deploy/derivation_outputs_id_and_derivation_id_idx.sql
new file mode 100644
index 0000000..1ec8e12
--- /dev/null
+++ b/sqitch/deploy/derivation_outputs_id_and_derivation_id_idx.sql
@@ -0,0 +1,7 @@
+-- Deploy guix-data-service:derivation_outputs_id_and_derivation_id_idx to pg
+
+BEGIN;
+
+CREATE INDEX derivation_outputs_id_and_derivation_id ON derivation_outputs (id, derivation_id);
+
+COMMIT;
diff --git a/sqitch/revert/derivation_outputs_id_and_derivation_id_idx.sql b/sqitch/revert/derivation_outputs_id_and_derivation_id_idx.sql
new file mode 100644
index 0000000..aaefb3a
--- /dev/null
+++ b/sqitch/revert/derivation_outputs_id_and_derivation_id_idx.sql
@@ -0,0 +1,7 @@
+-- Revert guix-data-service:derivation_outputs_id_and_derivation_id_idx from pg
+
+BEGIN;
+
+-- XXX Add DDLs here.
+
+COMMIT;
diff --git a/sqitch/sqitch.plan b/sqitch/sqitch.plan
index 8bc4aeb..d331920 100644
--- a/sqitch/sqitch.plan
+++ b/sqitch/sqitch.plan
@@ -91,3 +91,4 @@ git_repositories_query_substitutes 2022-09-09T11:35:16Z Chris <chris@felis> # Ad
package_derivations_id_package_id_idx 2022-09-14T09:24:30Z Chris <chris@felis> # Add index on package_derivations id and package_id
blocked_builds 2022-11-07T11:27:28Z Chris <chris@felis> # Add blocked_builds
package_derivations_extended_statistics 2022-11-12T10:40:18Z Chris <chris@felis> # Add extended statistics on package_derivations
+derivation_outputs_id_and_derivation_id_idx 2022-11-12T10:41:42Z Chris <chris@felis> # Add index on derivation_outputs id and derivation_id
diff --git a/sqitch/verify/derivation_outputs_id_and_derivation_id_idx.sql b/sqitch/verify/derivation_outputs_id_and_derivation_id_idx.sql
new file mode 100644
index 0000000..314b339
--- /dev/null
+++ b/sqitch/verify/derivation_outputs_id_and_derivation_id_idx.sql
@@ -0,0 +1,7 @@
+-- Verify guix-data-service:derivation_outputs_id_and_derivation_id_idx on pg
+
+BEGIN;
+
+-- XXX Add verifications here.
+
+ROLLBACK;