aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2019-12-29 17:55:04 +0000
committerChristopher Baines <mail@cbaines.net>2019-12-29 17:55:04 +0000
commit82b797ee9869ebe24f7dbbcc56c3d500e75dc2d3 (patch)
treec3bca8a2b7f1606b407009c0e349aeba01f3c83b
parent7e7cc1c8f17723bd909f84be11326cc1d47223d0 (diff)
downloaddata-service-82b797ee9869ebe24f7dbbcc56c3d500e75dc2d3.tar
data-service-82b797ee9869ebe24f7dbbcc56c3d500e75dc2d3.tar.gz
Create an index on the hash component of the store path
For derivation_source_files.
-rw-r--r--sqitch/deploy/derivation_source_files_store_path_hash_index.sql8
-rw-r--r--sqitch/revert/derivation_source_files_store_path_hash_index.sql7
-rw-r--r--sqitch/sqitch.plan1
-rw-r--r--sqitch/verify/derivation_source_files_store_path_hash_index.sql7
4 files changed, 23 insertions, 0 deletions
diff --git a/sqitch/deploy/derivation_source_files_store_path_hash_index.sql b/sqitch/deploy/derivation_source_files_store_path_hash_index.sql
new file mode 100644
index 0000000..4c1f3bb
--- /dev/null
+++ b/sqitch/deploy/derivation_source_files_store_path_hash_index.sql
@@ -0,0 +1,8 @@
+-- Deploy guix-data-service:derivation_source_files_store_path_hash_index to pg
+
+BEGIN;
+
+CREATE INDEX derivation_source_files_hash
+ ON derivation_source_files (substring(store_path from 12 for 32));
+
+COMMIT;
diff --git a/sqitch/revert/derivation_source_files_store_path_hash_index.sql b/sqitch/revert/derivation_source_files_store_path_hash_index.sql
new file mode 100644
index 0000000..89190d8
--- /dev/null
+++ b/sqitch/revert/derivation_source_files_store_path_hash_index.sql
@@ -0,0 +1,7 @@
+-- Revert guix-data-service:derivation_source_files_store_path_hash_index from pg
+
+BEGIN;
+
+DROP INDEX derivation_source_files_hash;
+
+COMMIT;
diff --git a/sqitch/sqitch.plan b/sqitch/sqitch.plan
index 7949320..9a23d31 100644
--- a/sqitch/sqitch.plan
+++ b/sqitch/sqitch.plan
@@ -40,3 +40,4 @@ derivation_output_sets 2019-12-05T23:19:05Z Christopher Baines <mail@cbaines.net
builds_add_derivation_output_details_set_id 2019-12-07T18:25:38Z Christopher Baines <mail@cbaines.net> # Add a derivation_output_details_set_id column to builds
derivations_hash_index 2019-12-24T22:54:19Z Christopher Baines <mail@cbaines.net> # Add index on derivations for the hash component of the filename
add_derivation_source_file_nars 2019-12-28T20:37:06Z Christopher Baines <mail@cbaines.net> # Add table for derivation source file nars
+derivation_source_files_store_path_hash_index 2019-12-29T17:53:08Z Christopher Baines <mail@cbaines.net> # Add index on the hash part of the derivation source files store path
diff --git a/sqitch/verify/derivation_source_files_store_path_hash_index.sql b/sqitch/verify/derivation_source_files_store_path_hash_index.sql
new file mode 100644
index 0000000..c3d12d2
--- /dev/null
+++ b/sqitch/verify/derivation_source_files_store_path_hash_index.sql
@@ -0,0 +1,7 @@
+-- Verify guix-data-service:derivation_source_files_store_path_hash_index on pg
+
+BEGIN;
+
+-- XXX Add verifications here.
+
+ROLLBACK;