[Yum-devel] Another patch to speed up depsolving

Gijs Hollestelle gijs at gewis.nl
Sun Apr 22 14:52:57 UTC 2007


Hi all,

I had another look at the depsolving today. I made a log of all the
queries being performed in sqlite and the time taken to execute them
and made a simple yet very efficient improvement.

Now for every package we get it's requirements, provides, etc by
performing a query like this:
select provides.* from provides,packages where provides.pkgKey =
packages.pkgKey and package.pkgId = 'foo'

This uses two tables in a join. Because yum is already smart enough to
know which sqlite database to query and because pkgKey's are unique
per database we can do this without the join by doing it directly on
the pkgKey:
select provides.* from provides where provides.pkgKey = 'bar'

This in total saves off 20 seconds on my machine for a large update.
Total time spent querying the sqlite database is 8 seconds now out of
the 32 seconds for the whole upgrade.

Originally the total time spent for this upgrade (current yum in
rawhide) was: 3:35 (215 seconds)
With this and my previous two patches applied: 32s seconds
In total a factor 6 speedup for the upgrade from test3 to rawhide!

BTW did anyone review the other 2 patches? Can I submit them to CVS?

Greets,
  Gijs
-------------- next part --------------
A non-text attachment was scrubbed...
Name: query-speed.patch
Type: text/x-patch
Size: 1502 bytes
Desc: not available
Url : http://lists.baseurl.org/pipermail/yum-devel/attachments/20070422/1dc205da/attachment.bin 


More information about the Yum-devel mailing list