I ran across a mention somewhere that doing an emit(key, doc)
will increase the amount of time an index takes to build (or something to that effect).
Is
Yes, it will increase the size of your index, because CouchDB effectively copies the entire document in those cases. For cases in which you can, use include_docs=true
.
There is, however, a race condition to be aware of when using this that is mentioned in the wiki. It is possible, during the time between reading the view data and fetching the document, that said document has changed (or has been deleted, in which case _deleted
will be true
). This is documented here under "Querying Options".