aboutsummaryrefslogtreecommitdiff
path: root/sqitch/deploy
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2022-11-12 10:40:43 +0000
committerChristopher Baines <mail@cbaines.net>2022-11-12 10:40:43 +0000
commitfb9d99a076ac3b4211f6dd96e125ee8d5d1477ef (patch)
treef9f4520b726039235e11adfb2a696507616d680a /sqitch/deploy
parent48d8ee885a6ca32a0984c429f085993e0669c8fb (diff)
downloaddata-service-fb9d99a076ac3b4211f6dd96e125ee8d5d1477ef.tar
data-service-fb9d99a076ac3b4211f6dd96e125ee8d5d1477ef.tar.gz
Add extended statistics on package_derivations
This helps row count estimates when filtering on system_id and target.
Diffstat (limited to 'sqitch/deploy')
-rw-r--r--sqitch/deploy/package_derivations_extended_statistics.sql9
1 files changed, 9 insertions, 0 deletions
diff --git a/sqitch/deploy/package_derivations_extended_statistics.sql b/sqitch/deploy/package_derivations_extended_statistics.sql
new file mode 100644
index 0000000..f1aeaaf
--- /dev/null
+++ b/sqitch/deploy/package_derivations_extended_statistics.sql
@@ -0,0 +1,9 @@
+-- Deploy guix-data-service:package_derivations_extended_statistics to pg
+
+BEGIN;
+
+CREATE STATISTICS package_derivations_mcv (mcv) ON system_id, target FROM package_derivations;
+
+CREATE STATISTICS package_derivations_ndistinct (ndistinct) ON system_id, target FROM package_derivations;
+
+COMMIT;