aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2024-10-04 08:14:38 +0100
committerChristopher Baines <mail@cbaines.net>2024-10-04 08:14:38 +0100
commitbb5b3731c8991adf786abc27a194e50446a4b8e6 (patch)
treed43806b8c8250d0070f7e8910a30a5212b76843c
parent53ddb26300ec16a2aafb9885919663c10d5149f4 (diff)
downloaddata-service-bb5b3731c8991adf786abc27a194e50446a4b8e6.tar
data-service-bb5b3731c8991adf786abc27a194e50446a4b8e6.tar.gz
Vacuum some tables when deleting derivations
-rw-r--r--guix-data-service/data-deletion.scm10
1 files changed, 10 insertions, 0 deletions
diff --git a/guix-data-service/data-deletion.scm b/guix-data-service/data-deletion.scm
index 13b3246..1e0f7e4 100644
--- a/guix-data-service/data-deletion.scm
+++ b/guix-data-service/data-deletion.scm
@@ -684,8 +684,18 @@ SET CONSTRAINTS derivations_by_output_details_set_derivation_id_fkey DEFERRED")
(if (= 0 batch-deleted-count)
(begin
(with-time-logging
+ "VACUUM derivation_inputs"
+ (exec-query conn "VACUUM (VERBOSE) derivation_inputs;"))
+ (with-time-logging
+ "VACUUM derivations"
+ (exec-query conn "VACUUM (VERBOSE) derivations;"))
+ (with-time-logging
"Deleting unused derivation_source_files entries"
(delete-unreferenced-derivations-source-files conn))
+ (with-time-logging
+ "VACUUM derivation_source_file_nars"
+ (exec-query
+ conn "VACUUM (VERBOSE) derivation_source_file_nars;"))
(simple-format
(current-output-port)
"Finished deleting derivations, deleted ~A in total\n"