guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: Only sometimes attempt manually computing n_disti


From: Christopher Baines
Subject: branch master updated: Only sometimes attempt manually computing n_distinct values
Date: Tue, 29 Nov 2022 05:37:25 -0500

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 9f05f5f  Only sometimes attempt manually computing n_distinct values
9f05f5f is described below

commit 9f05f5f4f944c75caf017f3464cef454539ab6b9
Author: Christopher Baines <mail@cbaines.net>
AuthorDate: Tue Nov 29 10:36:46 2022 +0000

    Only sometimes attempt manually computing n_distinct values
    
    For derivation_inputs.
---
 guix-data-service/jobs/load-new-guix-revision.scm | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/guix-data-service/jobs/load-new-guix-revision.scm 
b/guix-data-service/jobs/load-new-guix-revision.scm
index c1c27af..57d6e77 100644
--- a/guix-data-service/jobs/load-new-guix-revision.scm
+++ b/guix-data-service/jobs/load-new-guix-revision.scm
@@ -2142,9 +2142,18 @@ SKIP LOCKED")
                   "vacuuming package derivations by guix revision range table"
                 (vacuum-package-derivations-table conn))
 
-              (with-time-logging
-                  "update-derivation-inputs-statistics"
-                (update-derivation-inputs-statistics conn))
+              (match (exec-query
+                      conn
+                      "SELECT reltuples::integer FROM pg_class WHERE relname = 
'derivation_inputs'")
+                (((rows))
+                 ;; Don't attempt counting distinct values if there are too
+                 ;; many rows, as that is far to slow and could use up all the
+                 ;; disk space.
+                 (when (< (string->number rows)
+                          1000000000)
+                   (with-time-logging
+                       "update-derivation-inputs-statistics"
+                     (update-derivation-inputs-statistics conn)))))
 
               (with-time-logging
                   "vacuum-derivation-inputs-table"



reply via email to

[Prev in Thread] Current Thread [Next in Thread]