On Wed, Feb 10, 2010 at 8:27 PM, Sean Clark Hess <[email protected]> wrote: > If you emit a document as a value in a view, does it actually rewrite the > document on the disk somewhere, or just point to it? > > Is one faster than the other? >
Good question. The tradeoffs are balanced -- include_docs will be slower than emit(k, doc), but take up less space on disk. Anything that it emitted is stored in the view index file. Emit only what you need for your application. Include docs is meant as a convenience method for listing a small # of rows from an application (like in an administration interface). If you emit all (and only what) you need in your view values, you'll get the best performance. Keep view keys small (smaller is better for performance) I'd keep my keys less than 1 kb to be on the safe side, don't stress about keysize but don't go overboard. Best, Chris -- Chris Anderson http://jchrisa.net http://couch.io
