Add an index on the derivation_file_name field in the builds table

As this helps when finding builds relating to specific derivations.
This commit is contained in:
Christopher Baines 2019-12-04 22:03:52 +01:00
parent 716eb3c3b6
commit 299f9dc480
4 changed files with 22 additions and 0 deletions

View File

@ -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;

View File

@ -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;

View File

@ -30,3 +30,4 @@ channel_news_tables 2019-11-15T07:32:07Z Christopher Baines <mail@cbaines.net> #
build_server_token_seeds 2019-11-23T09:26:48Z Christopher Baines <mail@cbaines.net> # Add build_server_token_seeds table
rework_builds 2019-11-23T20:41:20Z Christopher Baines <mail@cbaines.net> # Rework the build tables
nar_related_tables 2019-11-29T20:28:19Z Christopher Baines <mail@cbaines.net> # Add nar related tables
add_index_on_builds_derivation_file_name 2019-12-03T16:23:55Z <chris@phact> # Add index on builds_derivation_file_name

View File

@ -0,0 +1,7 @@
-- Verify guix-data-service:add_index_on_builds_derivation_file_name on pg
BEGIN;
-- XXX Add verifications here.
ROLLBACK;