[Top][All Lists]

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

Re: File search progress: database review and question on triggers

From: Ricardo Wurmus
Subject: Re: File search progress: database review and question on triggers
Date: Tue, 11 Aug 2020 22:08:39 +0200
User-agent: mu4e 1.4.10; emacs 26.3

Pierre Neidhardt <> writes:

> Pierre Neidhardt <> writes:
>> Ricardo Wurmus <> writes:
>>> I’m not suggesting to use updatedb, but I think it can be instructive to
>>> look at how the file database is implemented there.  We don’t have to
>>> use SQlite if it is much slower and heavier than a custom inverted
>>> index.
>> Good call, I'll benchmark against an inverted index.
>> Some cost may also be induced by the Guix store queries, not sure if we
>> can optimize these.
> With an s-exp based file, or a trivial text-based format, the downside
> is that it needs a bit of extra work to only load select entries,
> e.g. just the entries matching a specific Guix version.
> Would you happen to know a serialization library that allows for loading
> only a select portion of a file?

I don’t know of any suitable file format, but a generated offset index
at the beginning of the file could be useful.  You’d read the first
expression and then seek to the specified byte offset (after the
position of the index expression) where you then read the target
expression.  This can easily be generated and it can be extended without
having to rewrite the whole file.

But perhaps that’s premature optimization.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]