Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 90695 invoked from network); 11 Feb 2010 04:47:29 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 11 Feb 2010 04:47:29 -0000 Received: (qmail 84008 invoked by uid 500); 11 Feb 2010 04:47:26 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 83911 invoked by uid 500); 11 Feb 2010 04:47:26 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 83894 invoked by uid 99); 11 Feb 2010 04:47:25 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Feb 2010 04:47:25 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of jchris@gmail.com designates 209.85.222.179 as permitted sender) Received: from [209.85.222.179] (HELO mail-pz0-f179.google.com) (209.85.222.179) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Feb 2010 04:47:15 +0000 Received: by pzk9 with SMTP id 9so982196pzk.28 for ; Wed, 10 Feb 2010 20:46:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=s4IFqOJuT+kWmRd42vxp3P34MGOGMS/yItdEq2MA3Ts=; b=hrYcGGOuUfVdBl2ay6M0eYD7b35E2emjoWX76eQiaBObFJpvjNagouDMDCPTLKlNQb yKpIZnQBNlL25jIfUL9XFlnFly1K33cE6XSvh6Gdo5eauew0SRykdmjUQtGR7qAkzSeu w9Bjrptl9WvX//lUmR5/SfZWX/2cJ23pbwnw4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=X3Az4ODcfgeOdGzvoNCgzMymM8uaq+SgJQ5+sDrcnUqqPQVZ55cxfIJ89VozdSiGRO oSBqLM08QN9BQNGFjSNsNicnZT8w+HXG59evvTY6PN+rAQpHfGcZvj6nrP42ntsOP3pt n7mabKYyBUu+8dyZTffLbr3VlGgq+a3LidijI= MIME-Version: 1.0 Sender: jchris@gmail.com Received: by 10.142.247.21 with SMTP id u21mr836084wfh.85.1265863614608; Wed, 10 Feb 2010 20:46:54 -0800 (PST) In-Reply-To: <21a5a18d1002102027u166d1e6fj532d98baec515638@mail.gmail.com> References: <21a5a18d1002102027u166d1e6fj532d98baec515638@mail.gmail.com> Date: Wed, 10 Feb 2010 20:46:54 -0800 X-Google-Sender-Auth: 62f1eeaba31bfb7d Message-ID: Subject: Re: include_docs vs emit("somekey", doc) From: Chris Anderson To: user@couchdb.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org On Wed, Feb 10, 2010 at 8:27 PM, Sean Clark Hess 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