title: How does couchdb retrieve all previous revisions?
body: <p>From what I understand, CouchDB's Btree implementation actually uses Shadowing technique, and every update will produce new root, the following excerpts from this <a href="http://citeseerx.ist.psu.edu/viewdoc/download;jsessionid=B6555F332EBB2A35B1FDDAEEB12A316C?doi=10.1.1.161.6863&amp;rep=rep1&amp;type=pdf" rel="noreferrer">PDF</a> (it looks like implementing a better algorithm than traditional shadowing).</p>
  
  <blockquote>
    <p>Shadowing means that to update an
    on-disk page, the entire page is read
    into memory, modified, and later
    written to disk at an alternate
    location. When a page is shadowed its
    location on disk changes, this creates
    a need to update (and shadow) the
    immediate ancestor of the page with
    the new address. Shadowing propagates
    up to the file system root.</p>
  </blockquote>
  
  <p>How does couchdb implement fetching all leaf revisions as possible as it can( since some revisions are removed by compacting process)? Does couch internally store a pointer which points to previous revisions?</p>
  
  <p>Thanks
  Chang</p>