diff options
author | Christopher Baines <mail@cbaines.net> | 2022-11-12 10:40:43 +0000 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2022-11-12 10:40:43 +0000 |
commit | fb9d99a076ac3b4211f6dd96e125ee8d5d1477ef (patch) | |
tree | f9f4520b726039235e11adfb2a696507616d680a | |
parent | 48d8ee885a6ca32a0984c429f085993e0669c8fb (diff) | |
download | data-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.
4 files changed, 24 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; diff --git a/sqitch/revert/package_derivations_extended_statistics.sql b/sqitch/revert/package_derivations_extended_statistics.sql new file mode 100644 index 0000000..65f3208 --- /dev/null +++ b/sqitch/revert/package_derivations_extended_statistics.sql @@ -0,0 +1,7 @@ +-- Revert guix-data-service:package_derivations_extended_statistics from pg + +BEGIN; + +-- XXX Add DDLs here. + +COMMIT; diff --git a/sqitch/sqitch.plan b/sqitch/sqitch.plan index 5af890d..8bc4aeb 100644 --- a/sqitch/sqitch.plan +++ b/sqitch/sqitch.plan @@ -90,3 +90,4 @@ fix_git_commits_duplicates 2022-06-17T10:39:50Z Chris <chris@felis> # Fix git_co git_repositories_query_substitutes 2022-09-09T11:35:16Z Chris <chris@felis> # Add git_repositories.query_substitutes package_derivations_id_package_id_idx 2022-09-14T09:24:30Z Chris <chris@felis> # Add index on package_derivations id and package_id blocked_builds 2022-11-07T11:27:28Z Chris <chris@felis> # Add blocked_builds +package_derivations_extended_statistics 2022-11-12T10:40:18Z Chris <chris@felis> # Add extended statistics on package_derivations diff --git a/sqitch/verify/package_derivations_extended_statistics.sql b/sqitch/verify/package_derivations_extended_statistics.sql new file mode 100644 index 0000000..1053d91 --- /dev/null +++ b/sqitch/verify/package_derivations_extended_statistics.sql @@ -0,0 +1,7 @@ +-- Verify guix-data-service:package_derivations_extended_statistics on pg + +BEGIN; + +-- XXX Add verifications here. + +ROLLBACK; |