Date: Mon, 12 May 2008 21:20:41 -0700 From: Tim Kientzle <kientzle@freebsd.org> To: Jeremy Lea <reg@freebsd.org> Cc: freebsd-hackers@freebsd.org, Anders Nore <andenore@start.no> Subject: Re: Adding .db support to pkg_tools Message-ID: <48291719.5010801@freebsd.org> In-Reply-To: <20080512204558.GA44114@flint.openpave.org> References: <op.uavxx8ip2n4ijf@duckjen.nextgentel.no> <20080512204558.GA44114@flint.openpave.org>
next in thread | previous in thread | raw e-mail | index | archive | help
> I think this is a really bad idea. The problem with the tools is not > with the files. It is that the files need to be parsed on each run, > often recursively, and your solution would not help at all. Parsing one file isn't expensive; parsing several hundred files to find one bit of information is expensive. > The database(s) should just be a cache of the information stored in the > files. Bingo! As long as the .db version can be easily recreated from scratch from the master data stored in the same files as always, it doesn't really matter if the BDB is occasionally corrupted, as long as it can be rebuilt fairly quickly. So, the key points are: * Use the .db file for lookups that can't be done quickly against the existing data. In particular, look for operations where the pkg tools have to scan a lot of files to verify a single fact. * Ensure the .db file can be deleted and rebuilt from scratch from the data in the regular files. Tim Kientzle
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?48291719.5010801>