aboutsummaryrefslogtreecommitdiff
path: root/sqitch/deploy
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2019-12-26 09:28:20 +0000
committerChristopher Baines <mail@cbaines.net>2019-12-26 09:28:20 +0000
commitff01144e871b7eaa3b91a3054fa57c3dbbb19702 (patch)
treece6e42084ff3c3f4cd35031dba545c26b403988e /sqitch/deploy
parenta8d58e05413b2d66fb7b168618836625dea3de88 (diff)
downloaddata-service-ff01144e871b7eaa3b91a3054fa57c3dbbb19702.tar
data-service-ff01144e871b7eaa3b91a3054fa57c3dbbb19702.tar.gz
Create an index for the hash component of derivation filenames
This is to aid rendering of narinfo files. They're requested with the path /HASH.narinfo, so to quickly find the relevant derivation, this index can be used.
Diffstat (limited to 'sqitch/deploy')
-rw-r--r--sqitch/deploy/derivations_hash_index.sql7
1 files changed, 7 insertions, 0 deletions
diff --git a/sqitch/deploy/derivations_hash_index.sql b/sqitch/deploy/derivations_hash_index.sql
new file mode 100644
index 0000000..869ff0a
--- /dev/null
+++ b/sqitch/deploy/derivations_hash_index.sql
@@ -0,0 +1,7 @@
+-- Deploy guix-data-service:derivations_hash_index to pg
+
+BEGIN;
+
+CREATE INDEX derivations_hash ON derivations (substring(file_name from 12 for 32));
+
+COMMIT;