Only sometimes attempt manually computing n_distinct values
For derivation_inputs.
This commit is contained in:
parent
6ada1cb845
commit
9f05f5f4f9
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue