[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
03/07: Add extended statistics on package_derivations
From: |
Christopher Baines |
Subject: |
03/07: Add extended statistics on package_derivations |
Date: |
Sat, 12 Nov 2022 05:59:12 -0500 (EST) |
cbaines pushed a commit to branch master
in repository data-service.
commit fb9d99a076ac3b4211f6dd96e125ee8d5d1477ef
Author: Christopher Baines <mail@cbaines.net>
AuthorDate: Sat Nov 12 10:40:43 2022 +0000
Add extended statistics on package_derivations
This helps row count estimates when filtering on system_id and target.
---
sqitch/deploy/package_derivations_extended_statistics.sql | 9 +++++++++
sqitch/revert/package_derivations_extended_statistics.sql | 7 +++++++
sqitch/sqitch.plan | 1 +
sqitch/verify/package_derivations_extended_statistics.sql | 7 +++++++
4 files changed, 24 insertions(+)
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;
- branch master updated (4101c6b -> 7731c6f), Christopher Baines, 2022/11/12
- 01/07: Rework insert-blocked-builds to make it more efficient, Christopher Baines, 2022/11/12
- 03/07: Add extended statistics on package_derivations,
Christopher Baines <=
- 06/07: Use latest_build_status rather than build_status, Christopher Baines, 2022/11/12
- 07/07: Tweak backfilling the blocked builds, Christopher Baines, 2022/11/12
- 02/07: Have insert-blocked-builds cache when the partitions exist, Christopher Baines, 2022/11/12
- 05/07: Spawn specific PostgreSQL connections for the blocked_builds updates, Christopher Baines, 2022/11/12
- 04/07: Add index on derivation_outputs id and derivation_id fields, Christopher Baines, 2022/11/12