[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: SQLite backend?



Hi,

(blowing some dust from my unfinished draft folder)

On Sun, Apr 28, 2019 at 11:30:37PM -0500, Jason Pepas wrote:
> Has anyone ever looked into using SQLite to store the package indexes?

I doubt anyone has seriously looked into it.

> I run Debian on some slow / weak hardware (e.g. an NSLU2) and "Reading
> package lists"

The indexes are parsed (ideally once) into a binary cache which is
mmaped directly into memory for followup calls. As such it is a special
purpose database and I doubt moving to a generic database with query
language on top (SQL) would get us any (speed) benefit.

Feel free to try & proof me wrong through.


> and "Building dependency tree"

That one can be slow yes & it is generated on every call, but it is hard
to cache as there are a billion ways to effect the calculation like
preferences, so that verifying that the cache is [still] valid becomes
a time consuming task all by itself.

The mid/long-term idea here is more to drop that part and go with
"just-in-time" calculation as with the growing number of packages it
becomes less and less effective.

It is currently rooted deeply in apt through while it should be solver
specific as different solvers will have different needs on how to
represent the information build here.


> can take several minutes.

It can take a while, but several minutes sounds wrong. That machine is
down for a while now, but my SheevaPlug should be in the same raw-power
class, and it wasn't that bad (oh, I should get that running again…).

Are you sure you haven't disabled the caches to save diskspace?
I remember having read many guides given advice for such machines more
along the "optimize for diskspace" than "for speed" axis without saying
explicitly what the various non-default options they recommend setting
actually do.


You could also try profiling the run, so we see what actually takes that
long. Perhaps there is something we can optimize if we have a better
understand of where the time is "wasted".


Best regards

David Kalnischkies

Attachment: signature.asc
Description: PGP signature


Reply to: