Return-Path: Delivered-To: apmail-incubator-couchdb-user-archive@locus.apache.org Received: (qmail 28904 invoked from network); 29 Jun 2008 05:39:16 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 29 Jun 2008 05:39:16 -0000 Received: (qmail 57804 invoked by uid 500); 29 Jun 2008 05:39:17 -0000 Delivered-To: apmail-incubator-couchdb-user-archive@incubator.apache.org Received: (qmail 57779 invoked by uid 500); 29 Jun 2008 05:39:17 -0000 Mailing-List: contact couchdb-user-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: couchdb-user@incubator.apache.org Delivered-To: mailing list couchdb-user@incubator.apache.org Received: (qmail 57768 invoked by uid 99); 29 Jun 2008 05:39:17 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 28 Jun 2008 22:39:17 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jchris@gmail.com designates 209.85.146.183 as permitted sender) Received: from [209.85.146.183] (HELO wa-out-1112.google.com) (209.85.146.183) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 29 Jun 2008 05:38:24 +0000 Received: by wa-out-1112.google.com with SMTP id m16so971753waf.6 for ; Sat, 28 Jun 2008 22:38:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender :to:subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references :x-google-sender-auth; bh=Lttk9+BAv3HSY9m+GY2+mvX4/OKMvOtdTsowKS8jGU8=; b=BHAgHR7XmL4ZGCHH7DeJY2ChEZO6ziu/tWke/NiM8bpBotud+2ffXrNzk0Ji5bmR8S 8DS/E3uWOPq97TPvZOzeep19gk4VvSCCF2YV+kzytD3hOVlijKYPxZI/chLwyQ9UwIWI RecUqi3FzEn0YZSGs3kGHs08qtUggCAacf0L4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references:x-google-sender-auth; b=x+rZ3DTTt9qCzV6cY4V2QFaiMCQasKIB4P+YSyosGdxnIwngZbOodS9nWa7siSSMD4 KlIiMix6pQYHgEYDxMbDtot3JnYEqTMfvg1NL4GTubbJgO5FSH1TobNQad8HYESWVluG ikfP7uayKViB8CBImFEnmIPQFZY79hySOUkBI= Received: by 10.115.108.1 with SMTP id k1mr105003wam.78.1214717922964; Sat, 28 Jun 2008 22:38:42 -0700 (PDT) Received: by 10.114.78.7 with HTTP; Sat, 28 Jun 2008 22:38:42 -0700 (PDT) Message-ID: Date: Sat, 28 Jun 2008 22:38:42 -0700 From: "Chris Anderson" Sender: jchris@gmail.com To: couchdb-user@incubator.apache.org Subject: Re: General-understanding questions about views In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <3F12B537-F1E1-45A5-857E-53E8CD5EC73E@ketralnis.com> <250C86A3-3F40-4C48-B05B-2ED9DCFF1109@apache.org> <8BC12E79-6DDE-499B-9C81-49C891C0B42E@ketralnis.com> X-Google-Sender-Auth: d96d3c6c55362bcb X-Virus-Checked: Checked by ClamAV on apache.org On Sat, Jun 28, 2008 at 9:17 PM, David King wrote: > But in the example I gave (that I got from the CouchDB wiki), there's no way > for the reduction to be accurate in the face of deletions and modifications > without re-calculating it for every single item in the database. That is, > given a database of 5 million rows, every time one is modified or deleted > (or possibly even added, depending on implementation), all 5 million rows > have to pass through that function > Now you're getting to the technical part. This quote from Damien is the best I can do for you: http://damienkatz.net/2008/02/incremental_map_1.html ... in this design, the reductions happen at index-update time, and the reductions are stored directly inside the inner nodes of the view b+tree index. Then at query time, the intermediate results are reduced to their final result. The number of reductions that happen at query time are logarithmic with respect to the number of matching key/values. -- Chris Anderson http://jchris.mfdz.com