[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
12/13: squash! Add one variant of each package (name/version pair).
From: |
guix-commits |
Subject: |
12/13: squash! Add one variant of each package (name/version pair). |
Date: |
Sun, 21 May 2023 17:40:24 -0400 (EDT) |
civodul pushed a commit to branch wip-guix-index
in repository guix.
commit 96c871a63d36189717b3355dbb1b7b33355f4234
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Sun May 21 18:22:05 2023 +0200
squash! Add one variant of each package (name/version pair).
database goes from 148 MiB -> 52 MiB.
indexing time goes from 93s to 44s.
---
guix/scripts/index.scm | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/guix/scripts/index.scm b/guix/scripts/index.scm
index c4996815b5..9ba2cccc87 100644
--- a/guix/scripts/index.scm
+++ b/guix/scripts/index.scm
@@ -167,7 +167,7 @@ VALUES (:name, :version, :output);"
(define stmt-select-directory
(sqlite-prepare db "\
-SELECT id FROM Directories WHERE name = :name AND package = :package;"
+SELECT id FROM Directories WHERE package = :package;"
#:cache? #t))
(define stmt-insert-directory
@@ -202,10 +202,13 @@ VALUES (:name, :basename, :directory);"
(define (strip file)
(string-drop file (+ (string-length directory) 1)))
- ;; If DIRECTORY is already present in the database, skip it.
+ ;; If there's already a directory associated with PACKAGE-ID,
+ ;; not necessarily the same directory, skip it. That keeps
+ ;; the database slimmer at the expense of not recording
+ ;; variants of the same package; it also makes indexing
+ ;; faster.
(sqlite-reset stmt-select-directory)
(sqlite-bind-arguments stmt-select-directory
- #:name directory
#:package package-id)
(when (null? (sqlite-fold cons '() stmt-select-directory))
;; DIRECTORY is missing so insert it and traverse it.
- 06/13: squash! "with-method" -> "method", (continued)
- 06/13: squash! "with-method" -> "method", guix-commits, 2023/05/21
- 03/13: squash! Update test., guix-commits, 2023/05/21
- 05/13: squash! Improve error reporting and i18n., guix-commits, 2023/05/21
- 08/13: squash! Remove debugging statements., guix-commits, 2023/05/21
- 01/13: store: Tolerate non-existent GC root directories., guix-commits, 2023/05/21
- 07/13: squash! Don't insert directory if it's already present., guix-commits, 2023/05/21
- 10/13: squash! Do not insert the same directory more than once., guix-commits, 2023/05/21
- 11/13: squash! Keep store prefix in database., guix-commits, 2023/05/21
- 13/13: squash! Create database when it doesn't already exist., guix-commits, 2023/05/21
- 09/13: squash! Choose system-wide database if it's more recent., guix-commits, 2023/05/21
- 12/13: squash! Add one variant of each package (name/version pair).,
guix-commits <=
- 02/13: DRAFT Add 'guix index'., guix-commits, 2023/05/21
- 04/13: squash! "--db-path" -> "--database"., guix-commits, 2023/05/21