diff options
author | Christopher Baines <mail@cbaines.net> | 2024-10-04 08:14:38 +0100 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2024-10-04 08:14:38 +0100 |
commit | bb5b3731c8991adf786abc27a194e50446a4b8e6 (patch) | |
tree | d43806b8c8250d0070f7e8910a30a5212b76843c | |
parent | 53ddb26300ec16a2aafb9885919663c10d5149f4 (diff) | |
download | data-service-bb5b3731c8991adf786abc27a194e50446a4b8e6.tar data-service-bb5b3731c8991adf786abc27a194e50446a4b8e6.tar.gz |
Vacuum some tables when deleting derivations
-rw-r--r-- | guix-data-service/data-deletion.scm | 10 |
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" |