From d3b063ef3d8468f88476126771b5be0bd925ca66 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Thu, 5 Dec 2019 14:28:02 +0200 Subject: [PATCH] Use the new index key iterator for dependency check hashes In normal transactions this is but a drop in the ocean. However on rpm -Va, the hashes get rebuilt from scratch on every single package which on my moderate rpmdb (~2800 packages) testcase results in 103418347 data values fetched and added to dbi sets that are only thrown away. With bdb and lmdb this is only a minor optimization but for ndb and sqlite which can retrieve keys independently, this is a much bigger win. In case of sqlite, it's a massive one. Update all backends to allow for NULL set in the index retrieve to signal key-only retrieval. --- lib/depends.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/depends.c b/lib/depends.c index 672a562c39..320d0daf6f 100644 --- a/lib/depends.c +++ b/lib/depends.c @@ -938,7 +938,7 @@ static void addIndexToDepHashes(rpmts ts, rpmDbiTag tag, { char *key; size_t keylen; - rpmdbIndexIterator ii = rpmdbIndexIteratorInit(rpmtsGetRdb(ts), tag); + rpmdbIndexIterator ii = rpmdbIndexKeyIteratorInit(rpmtsGetRdb(ts), tag); if (!ii) return;