[RFC] Strawman replacement local directory state

Martin Pool mbp at canonical.com
Wed Jun 14 21:11:00 BST 2006


On 14/06/2006, at 2:50 AM, John Arbash Meinel wrote:

> While we are talking about strawmen, what about using an sqlite db for
> the dirstate.
> It supports locking, transactions, indexed lookups. If we design the
> schema well, we should be able to get very good performance.
> The parser is written in C, so we decrease the python overhead.
> It should be very easy to get subset information (select * from files
> where parent_dir = '/this/dir').
>
> Because we are using the db only for the local dirstate, we aren't
> committing anything to the archive which is a binary blob. Also, the
> schema can be very simple, since it only needs to hold the current
> information.

A tdb could be another good option; it's arguably somewhat simpler  
than sqlite.  The main advantages would seem to be

  - faster lookup by name
  - update, insert or remove elements without rewriting the whole file

On the other hand common operations need to read the whole thing in  
order (as Robert says on that page) and sqlite or tdb may not help much.

At any rate if we introduce the basic idea that there is an object  
which knows about the working inventory, its merge parents, and the  
files on disk then we can play with other options later.

-- 
Martin







More information about the bazaar mailing list