incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pulkit Singhal <pulkitsing...@gmail.com>
Subject How does the B-tree for view indexes behave?
Date Sat, 08 Oct 2011 01:59:14 GMT
If this is not an inappropriate place to ask these questions, then please
point me in the right direction :)

1) Does CouchDB mark existing rows in a view index as "invalid" for ALL of
the following operations: add,delete, edit?
2) For deletes: Is the info not added at the end of the B-tree for the view
index?
3) Does CouchDB break out of its "append-only-model" if a document gets
updated for a view index? Are the resulting new lines really inserted into
the B-tree? Why the change in behavior?

I am basing my questions on the following excerpt @
http://guide.couchdb.org/draft/views.html#lookups
"What happens, though, when you change a document, add a new one, or delete
one? Easy: CouchDB is smart enough to find the rows in the view result that
were created by a specific document. It marks them invalid so that they no
longer show up in view results. If the document was deleted, we’re good—the
resulting B-tree reflects the state of the database. If a document got
updated, the new document is run through the map function and the resulting
new lines are inserted into the B-tree at the correct spots. New documents
are handled in the same way. Appendix F, The Power of B-trees demonstrates
that a B-tree is a very efficient data structure for our needs, and the
crash-only design of CouchDB databases is carried over to the view indexes
as well. "

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message