aboutsummaryrefslogtreecommitdiff
path: root/sqitch
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2020-07-04 08:59:29 +0100
committerChristopher Baines <mail@cbaines.net>2020-07-04 08:59:29 +0100
commit5dc9ed65ff179e71b34235d0a96729577cab3bd7 (patch)
treeece1899edf6b4c1b27f18e83d910d23e48186f19 /sqitch
parent4b1dc76f186439cbc2b2c8d8238814b242b68417 (diff)
downloaddata-service-5dc9ed65ff179e71b34235d0a96729577cab3bd7.tar
data-service-5dc9ed65ff179e71b34235d0a96729577cab3bd7.tar.gz
Add a index to derivation_output_details_sets
This helps with queries like: SELECT * FROM derivation_output_details_sets WHERE ARRAY[5563227] <@ derivation_output_details_ids;
Diffstat (limited to 'sqitch')
-rw-r--r--sqitch/deploy/derivation_output_details_sets_derivation_output_details_ids_index.sql9
-rw-r--r--sqitch/revert/derivation_output_details_sets_derivation_output_details_ids_index.sql7
-rw-r--r--sqitch/sqitch.plan1
-rw-r--r--sqitch/verify/derivation_output_details_sets_derivation_output_details_ids_index.sql7
4 files changed, 24 insertions, 0 deletions
diff --git a/sqitch/deploy/derivation_output_details_sets_derivation_output_details_ids_index.sql b/sqitch/deploy/derivation_output_details_sets_derivation_output_details_ids_index.sql
new file mode 100644
index 0000000..c755127
--- /dev/null
+++ b/sqitch/deploy/derivation_output_details_sets_derivation_output_details_ids_index.sql
@@ -0,0 +1,9 @@
+-- Deploy guix-data-service:derivation_output_details_sets_derivation_output_details_ids_index to pg
+
+BEGIN;
+
+CREATE INDEX derivation_output_details_sets_gin_idx
+ ON derivation_output_details_sets
+ USING GIN (derivation_output_details_ids);
+
+COMMIT;
diff --git a/sqitch/revert/derivation_output_details_sets_derivation_output_details_ids_index.sql b/sqitch/revert/derivation_output_details_sets_derivation_output_details_ids_index.sql
new file mode 100644
index 0000000..aef856b
--- /dev/null
+++ b/sqitch/revert/derivation_output_details_sets_derivation_output_details_ids_index.sql
@@ -0,0 +1,7 @@
+-- Revert guix-data-service:derivation_output_details_sets_derivation_output_details_ids_index from pg
+
+BEGIN;
+
+-- XXX Add DDLs here.
+
+COMMIT;
diff --git a/sqitch/sqitch.plan b/sqitch/sqitch.plan
index c47cb84..8b165c1 100644
--- a/sqitch/sqitch.plan
+++ b/sqitch/sqitch.plan
@@ -65,3 +65,4 @@ build_status_nullable_timestamp 2020-06-27T12:34:29Z Christopher Baines <mail@cb
build_add_build_server_build_id 2020-06-27T12:48:57Z Christopher Baines <mail@cbaines.net> # Add builds.build_server_build_id
build_status_add_unique_index 2020-06-30T17:19:30Z Christopher Baines <mail@cbaines.net> # Add a unique index to the build_status table
builds_remove_build_server_id_derivation_unique_constraint 2020-06-30T20:17:48Z Christopher Baines <mail@cbaines.net> # Allow multiple builds of the same derivation per build server
+derivation_output_details_sets_derivation_output_details_ids_index 2020-07-04T07:56:49Z Christopher Baines <mail@cbaines.net> # Add GIN index on derivation_output_details_ids
diff --git a/sqitch/verify/derivation_output_details_sets_derivation_output_details_ids_index.sql b/sqitch/verify/derivation_output_details_sets_derivation_output_details_ids_index.sql
new file mode 100644
index 0000000..977edb2
--- /dev/null
+++ b/sqitch/verify/derivation_output_details_sets_derivation_output_details_ids_index.sql
@@ -0,0 +1,7 @@
+-- Verify guix-data-service:derivation_output_details_sets_derivation_output_details_ids_index on pg
+
+BEGIN;
+
+-- XXX Add verifications here.
+
+ROLLBACK;