couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Anderson <jch...@apache.org>
Subject Re: include_docs vs emit("somekey", doc)
Date Thu, 11 Feb 2010 04:46:54 GMT
On Wed, Feb 10, 2010 at 8:27 PM, Sean Clark Hess <seanhess@gmail.com> 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

Mime
View raw message