[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: Stop recursing now that derivation deletion selec
From: |
Christopher Baines |
Subject: |
branch master updated: Stop recursing now that derivation deletion selection is smarter |
Date: |
Wed, 30 Sep 2020 15:08:24 -0400 |
This is an automated email from the git hooks/post-receive script.
cbaines pushed a commit to branch master
in repository data-service.
The following commit(s) were added to refs/heads/master by this push:
new d844b32 Stop recursing now that derivation deletion selection is
smarter
d844b32 is described below
commit d844b325e213c21059452be672ba13c729dd7a4b
Author: Christopher Baines <mail@cbaines.net>
AuthorDate: Wed Sep 30 20:07:41 2020 +0100
Stop recursing now that derivation deletion selection is smarter
As this probably won't help with performance.
---
guix-data-service/data-deletion.scm | 43 +++++++++----------------------------
1 file changed, 10 insertions(+), 33 deletions(-)
diff --git a/guix-data-service/data-deletion.scm
b/guix-data-service/data-deletion.scm
index 639d2b1..40a5bab 100644
--- a/guix-data-service/data-deletion.scm
+++ b/guix-data-service/data-deletion.scm
@@ -389,42 +389,19 @@ DELETE FROM derivation_output_details_sets
WHERE id = $1"
(list derivation-output-details-set-id)))))))
- (let ((input-derivations
- (map car
- (exec-query
- conn
- "
-SELECT DISTINCT derivations.id
-FROM derivations
-WHERE derivations.id IN (
- SELECT derivation_outputs.derivation_id
- FROM derivation_outputs
- INNER JOIN derivation_inputs
- ON derivation_outputs.id = derivation_inputs.derivation_output_id
- WHERE derivation_inputs.derivation_id = $1
-)"
- (list id)))))
-
- (exec-query
- conn
- "
+ (exec-query
+ conn
+ "
DELETE FROM derivation_inputs WHERE derivation_id = $1"
- (list id))
+ (list id))
- (exec-query
- conn
- "
+ (exec-query
+ conn
+ "
DELETE FROM derivations WHERE id = $1"
- (list id))
-
- ;; Look at the inputs to see if they can be deleted too, as one of
- ;; the derivations that was using them has now been deleted.
- (fold
- (lambda (id result)
- (+ result
- (maybe-delete-derivation conn id)))
- 1
- input-derivations)))))
+ (list id))
+
+ 1)))
(with-postgresql-connection
"data-deletion"
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: Stop recursing now that derivation deletion selection is smarter,
Christopher Baines <=