aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2019-12-05 17:19:04 +0100
committerChristopher Baines <mail@cbaines.net>2019-12-12 20:07:22 +0000
commit0e97c55c0cabd6c3d2254e7bb02aa03ecf3314ca (patch)
tree67e8ef689a91a74eefd6001ba06bf07cf9f2f325
parent00bfa5336e98fd20b7547abd7899d2c4a2a169c7 (diff)
downloaddata-service-0e97c55c0cabd6c3d2254e7bb02aa03ecf3314ca.tar
data-service-0e97c55c0cabd6c3d2254e7bb02aa03ecf3314ca.tar.gz
Add some database indexes
-rw-r--r--sqitch/deploy/add_some_database_indexes.sql10
-rw-r--r--sqitch/revert/add_some_database_indexes.sql7
-rw-r--r--sqitch/sqitch.plan1
-rw-r--r--sqitch/verify/add_some_database_indexes.sql7
4 files changed, 25 insertions, 0 deletions
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 <chris@phact> # Add a table to descr
change_nars_size_to_bigint 2019-12-04T21:24:21Z <chris@phact> # Change nars.size to bigint
change_nar_urls_size_to_bigint 2019-12-04T21:49:07Z <chris@phact> # Change nar_urls.size to bigint
sort_out_duplicate_builds 2019-12-05T12:43:53Z <chris@phact> # Sort out duplicate builds
+add_some_database_indexes 2019-12-05T15:53:04Z Christopher Baines <mail@cbaines.net> # 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;