From 82b797ee9869ebe24f7dbbcc56c3d500e75dc2d3 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Sun, 29 Dec 2019 17:55:04 +0000 Subject: Create an index on the hash component of the store path For derivation_source_files. --- sqitch/deploy/derivation_source_files_store_path_hash_index.sql | 8 ++++++++ sqitch/revert/derivation_source_files_store_path_hash_index.sql | 7 +++++++ sqitch/sqitch.plan | 1 + sqitch/verify/derivation_source_files_store_path_hash_index.sql | 7 +++++++ 4 files changed, 23 insertions(+) create mode 100644 sqitch/deploy/derivation_source_files_store_path_hash_index.sql create mode 100644 sqitch/revert/derivation_source_files_store_path_hash_index.sql create mode 100644 sqitch/verify/derivation_source_files_store_path_hash_index.sql 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 # Add a derivation_output_details_set_id column to builds derivations_hash_index 2019-12-24T22:54:19Z Christopher Baines # Add index on derivations for the hash component of the filename add_derivation_source_file_nars 2019-12-28T20:37:06Z Christopher Baines # Add table for derivation source file nars +derivation_source_files_store_path_hash_index 2019-12-29T17:53:08Z Christopher Baines # 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; -- cgit v1.2.3