Return-Path: Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: (qmail 33498 invoked from network); 1 Oct 2009 15:41:22 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 1 Oct 2009 15:41:22 -0000 Received: (qmail 26513 invoked by uid 500); 1 Oct 2009 15:41:21 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 26448 invoked by uid 500); 1 Oct 2009 15:41:21 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Received: (qmail 26438 invoked by uid 99); 1 Oct 2009 15:41:21 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Oct 2009 15:41:21 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of hallettj@gmail.com designates 209.85.210.176 as permitted sender) Received: from [209.85.210.176] (HELO mail-yx0-f176.google.com) (209.85.210.176) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Oct 2009 15:41:11 +0000 Received: by yxe6 with SMTP id 6so196689yxe.13 for ; Thu, 01 Oct 2009 08:39:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=x/Ftm1cvplPwE4I86TZfsPJ+cz/OT2LRhV8X053WFdQ=; b=lMP22sxow10GnvuZ2aDnZ82uxDJ5u6xQqD5cb08AUcXQCsEeU0mmdARawSkZeKgo0q WSA0UL5qqK3em+RXmfsT3UzPb8wLzMaJ5SyVuJF3YM1AUUO330NCOMh8xE+PhfdF376n H1piUoPAAJVCv9zf5JCr40hjz4RQ/mx8ddTzo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=LlUSzJ4Yr2Jcj/08WrEi4h5t2Xug0vXcf6x5+YIftUlEWoD3PMk6rVMU2u/egYvZZ8 Z+BJR0sJKl3LfJLeFvMux86HJaQ9XdCdtNAy6rIKrDnc1AfvQgTZvAmAScWeiz3DpBHJ zu/0uyGTyZUecPMcTprJa4puUoMxICsWNOBHk= MIME-Version: 1.0 Received: by 10.150.74.6 with SMTP id w6mr2452975yba.317.1254411589364; Thu, 01 Oct 2009 08:39:49 -0700 (PDT) In-Reply-To: References: Date: Thu, 1 Oct 2009 08:39:49 -0700 Message-ID: <8a02878f0910010839w33e84912r77da265b4efac562@mail.gmail.com> Subject: Re: Views From: Jesse Hallett To: dev@couchdb.apache.org Content-Type: multipart/alternative; boundary=000e0cd302682fadc90474e175a1 X-Virus-Checked: Checked by ClamAV on apache.org --000e0cd302682fadc90474e175a1 Content-Type: text/plain; charset=ISO-8859-1 Every row emitted by the map function retains a reference to the original document. In addition to that any data emitted by the map function is duplicated in the view data. This is why one common strategy is to `emit(doc.someKey, null)`. That way you can use the `includedocs=true` option in queries to get document data while using as little disk space as possible for the view. But the downside is that this requires an additional btree traversal for every row returned by the query to get the original document data. For each view the outputs from the map function and reduce function are stored separately in separate btrees. If you have multiple views in a design document with map functions that are byte-for-byte identical then CouchDB will produce one btree that they all share. This let's you use the same map function with different reduce functions without unnecessary duplication of view data. On Oct 1, 2009 8:12 AM, "Amnon Lahav" wrote: Hi , I have two basic questions: I wasn't able to understand from the documentation if a view essentially duplicates the data (e.g. : emit(doc.code , doc)) or just keeps a reference to the document ? Also it's unclear to me how the same tree is used for two views that live inside the same design document , what exactly does that mean ? Thanks in advance . Amnon Lahav J2EE Developer , Admin Team www.amadesa.com - Web Site Testing & Personalization to Improve Conversion * alahav@amadesa.com Tel: Mobile: 972.544.646499 Download a complimentary copy of Forrester Research's "Sharpening Web Site Relevance" and read how Amadesa delivered an incremental $1.3 million for Smooth Fitness: http://www.amadesa.com/downloads --000e0cd302682fadc90474e175a1--