From 0e97c55c0cabd6c3d2254e7bb02aa03ecf3314ca Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Thu, 5 Dec 2019 17:19:04 +0100 Subject: Add some database indexes --- sqitch/deploy/add_some_database_indexes.sql | 10 ++++++++++ sqitch/revert/add_some_database_indexes.sql | 7 +++++++ sqitch/sqitch.plan | 1 + sqitch/verify/add_some_database_indexes.sql | 7 +++++++ 4 files changed, 25 insertions(+) create mode 100644 sqitch/deploy/add_some_database_indexes.sql create mode 100644 sqitch/revert/add_some_database_indexes.sql create mode 100644 sqitch/verify/add_some_database_indexes.sql (limited to 'sqitch') diff --git a/sqitch/deploy/add_some_database_indexes.sql b/sqitch/deploy/add_some_database_indexes.sql new file mode 100644 index 0000000..1af1d3f --- /dev/null +++ b/sqitch/deploy/add_some_database_indexes.sql @@ -0,0 +1,10 @@ +-- Deploy guix-data-service:add_some_database_indexes to pg + +BEGIN; + +CREATE INDEX ON derivation_outputs (derivation_id); +CREATE INDEX ON derivation_outputs (derivation_output_details_id); +CREATE INDEX ON nars (store_path); +CREATE INDEX ON package_derivations (package_id); + +COMMIT; diff --git a/sqitch/revert/add_some_database_indexes.sql b/sqitch/revert/add_some_database_indexes.sql new file mode 100644 index 0000000..4331aa9 --- /dev/null +++ b/sqitch/revert/add_some_database_indexes.sql @@ -0,0 +1,7 @@ +-- Revert guix-data-service:add_some_database_indexes from pg + +BEGIN; + +-- XXX Add DDLs here. + +COMMIT; diff --git a/sqitch/sqitch.plan b/sqitch/sqitch.plan index c323eef..58b272d 100644 --- a/sqitch/sqitch.plan +++ b/sqitch/sqitch.plan @@ -35,3 +35,4 @@ narinfo_fetch_record 2019-12-03T20:53:28Z # Add a table to descr change_nars_size_to_bigint 2019-12-04T21:24:21Z # Change nars.size to bigint change_nar_urls_size_to_bigint 2019-12-04T21:49:07Z # Change nar_urls.size to bigint sort_out_duplicate_builds 2019-12-05T12:43:53Z # Sort out duplicate builds +add_some_database_indexes 2019-12-05T15:53:04Z Christopher Baines # Add some indexes diff --git a/sqitch/verify/add_some_database_indexes.sql b/sqitch/verify/add_some_database_indexes.sql new file mode 100644 index 0000000..9701544 --- /dev/null +++ b/sqitch/verify/add_some_database_indexes.sql @@ -0,0 +1,7 @@ +-- Verify guix-data-service:add_some_database_indexes on pg + +BEGIN; + +-- XXX Add verifications here. + +ROLLBACK; -- cgit v1.2.3