Adam Kocoloski | 1 Jul 2011 17:57
Picon
Favicon
Gravatar

Re: Frugal Erlang vs Resources Hungry CouchDB

On Jul 1, 2011, at 11:23 AM, Jens Alfke wrote:

> I am not sure whether the db looks up older revisions of documents by starting from an earlier header
(“going back in time”); I don’t think so, because this would be inefficient (O(N)) for finding a
specific revision of a document. Instead my hunch is that each document points back to the position in the
file of its previous revision. (Again, disclaimer, I am extrapolating based on my knowledge of similar
data structures.)

Hi Jens, in fact, each leaf in the ID btree contains stores a revision tree containing pointers to _all_
available revisions of a document.  Retrieving an old revision (before compaction) or a conflicting
version of a document requires exactly the same number of IOs as retrieving the current one.  Cheers,

Adam

Gmane