[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
12/20: squash! Add one variant of each package (name/version pair).
From: |
guix-commits |
Subject: |
12/20: squash! Add one variant of each package (name/version pair). |
Date: |
Sun, 4 Jun 2023 17:34:41 -0400 (EDT) |
civodul pushed a commit to branch wip-guix-index
in repository guix.
commit 27a5465d7708c8a757d8f0a9fd284093d44f3303
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.
- branch wip-guix-index created (now 861a4e42e7), guix-commits, 2023/06/04
- 04/20: squash! "--db-path" -> "--database"., guix-commits, 2023/06/04
- 07/20: squash! Don't insert directory if it's already present., guix-commits, 2023/06/04
- 08/20: squash! Remove debugging statements., guix-commits, 2023/06/04
- 12/20: squash! Add one variant of each package (name/version pair).,
guix-commits <=
- 13/20: squash! Create database when it doesn't already exist., guix-commits, 2023/06/04
- 16/20: squash! Simplify '--help'., guix-commits, 2023/06/04
- 18/20: squash! Optimize 'insert-package'., guix-commits, 2023/06/04
- 19/20: squash! Show output name except for "out"; remove '-d'., guix-commits, 2023/06/04
- 02/20: DRAFT Add 'guix index'., guix-commits, 2023/06/04
- 03/20: squash! Update test., guix-commits, 2023/06/04
- 05/20: squash! Improve error reporting and i18n., guix-commits, 2023/06/04
- 01/20: store: Tolerate non-existent GC root directories., guix-commits, 2023/06/04
- 06/20: squash! "with-method" -> "method", guix-commits, 2023/06/04
- 09/20: squash! Choose system-wide database if it's more recent., guix-commits, 2023/06/04