From 299f9dc4807627f0f6ee3c4040893461de55f997 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Wed, 4 Dec 2019 22:03:52 +0100 Subject: Add an index on the derivation_file_name field in the builds table As this helps when finding builds relating to specific derivations. --- sqitch/deploy/add_index_on_builds_derivation_file_name.sql | 7 +++++++ sqitch/revert/add_index_on_builds_derivation_file_name.sql | 7 +++++++ sqitch/sqitch.plan | 1 + sqitch/verify/add_index_on_builds_derivation_file_name.sql | 7 +++++++ 4 files changed, 22 insertions(+) create mode 100644 sqitch/deploy/add_index_on_builds_derivation_file_name.sql create mode 100644 sqitch/revert/add_index_on_builds_derivation_file_name.sql create mode 100644 sqitch/verify/add_index_on_builds_derivation_file_name.sql diff --git a/sqitch/deploy/add_index_on_builds_derivation_file_name.sql b/sqitch/deploy/add_index_on_builds_derivation_file_name.sql new file mode 100644 index 0000000..be76be8 --- /dev/null +++ b/sqitch/deploy/add_index_on_builds_derivation_file_name.sql @@ -0,0 +1,7 @@ +-- Deploy guix-data-service:add_index_on_builds_derivation_file_name to pg + +BEGIN; + +CREATE INDEX builds_derivation_file_name ON builds(derivation_file_name); + +COMMIT; diff --git a/sqitch/revert/add_index_on_builds_derivation_file_name.sql b/sqitch/revert/add_index_on_builds_derivation_file_name.sql new file mode 100644 index 0000000..6aedcb3 --- /dev/null +++ b/sqitch/revert/add_index_on_builds_derivation_file_name.sql @@ -0,0 +1,7 @@ +-- Revert guix-data-service:add_index_on_builds_derivation_file_name from pg + +BEGIN; + +DROP INDEX builds_derivation_file_name; + +COMMIT; diff --git a/sqitch/sqitch.plan b/sqitch/sqitch.plan index c6de817..e79df69 100644 --- a/sqitch/sqitch.plan +++ b/sqitch/sqitch.plan @@ -30,3 +30,4 @@ channel_news_tables 2019-11-15T07:32:07Z Christopher Baines # build_server_token_seeds 2019-11-23T09:26:48Z Christopher Baines # Add build_server_token_seeds table rework_builds 2019-11-23T20:41:20Z Christopher Baines # Rework the build tables nar_related_tables 2019-11-29T20:28:19Z Christopher Baines # Add nar related tables +add_index_on_builds_derivation_file_name 2019-12-03T16:23:55Z # Add index on builds_derivation_file_name diff --git a/sqitch/verify/add_index_on_builds_derivation_file_name.sql b/sqitch/verify/add_index_on_builds_derivation_file_name.sql new file mode 100644 index 0000000..3f03487 --- /dev/null +++ b/sqitch/verify/add_index_on_builds_derivation_file_name.sql @@ -0,0 +1,7 @@ +-- Verify guix-data-service:add_index_on_builds_derivation_file_name on pg + +BEGIN; + +-- XXX Add verifications here. + +ROLLBACK; -- cgit v1.2.3