Return-Path: Delivered-To: apmail-incubator-couchdb-user-archive@locus.apache.org Received: (qmail 35068 invoked from network); 27 Oct 2008 20:37:32 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 27 Oct 2008 20:37:32 -0000 Received: (qmail 59649 invoked by uid 500); 27 Oct 2008 20:37:36 -0000 Delivered-To: apmail-incubator-couchdb-user-archive@incubator.apache.org Received: (qmail 59617 invoked by uid 500); 27 Oct 2008 20:37:36 -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 59606 invoked by uid 99); 27 Oct 2008 20:37:36 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Oct 2008 13:37:36 -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 64.233.182.186 as permitted sender) Received: from [64.233.182.186] (HELO nf-out-0910.google.com) (64.233.182.186) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Oct 2008 20:36:21 +0000 Received: by nf-out-0910.google.com with SMTP id c7so1040994nfi.40 for ; Mon, 27 Oct 2008 13:36:55 -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=beBoSQHdtFbaVcMwOCMWeHpVz5mY+hLctbqjSz4zBos=; b=Nn1UEgdPpJjkO5/fqUq0Tiu9+JF8Bw4UqtLFJy5/WDRz/C8Vta3SX37NBkDAQTLqk0 /h/fygfmj6+E71v4tEBN9VqQ8HQt7YwNysjj1Bys+fXJs5+9dOZpQYmqgSgH0iXVpv8d j5+gkczxNJAb2VKtTb2U9iMUiZ5jK6HL8E3UM= 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=s02B/bEGDUrnF0/yD8WhcneNGoUa89zTJC43YwFiS0NJ4m2O5SLtGZblCdb2w9c2VI lLIe1o3DdZqaq5bfH1zoo45i0QTVAmYvTRd1bffGCDPLeys0dmnfySpYG5aFq7MOvglj 00n9XNK/G/PWpCxMhpRuBnttgliFZYxOUDR2Y= Received: by 10.210.23.3 with SMTP id 3mr2945940ebw.23.1225139815044; Mon, 27 Oct 2008 13:36:55 -0700 (PDT) Received: by 10.210.54.17 with HTTP; Mon, 27 Oct 2008 13:36:54 -0700 (PDT) Message-ID: Date: Mon, 27 Oct 2008 13:36:54 -0700 From: "Chris Anderson" Sender: jchris@gmail.com To: couchdb-user@incubator.apache.org Subject: Re: Efficient view design question In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <1ac9e0120810261220h1528d201ta638c181b654829@mail.gmail.com> <137D1127-02E5-40BC-9432-B3CF4172148B@apache.org> <64a10fff0810270915g23cfa06fs42c9888a5bd4e6a4@mail.gmail.com> <11F243A6-EF0A-414F-A89E-6AAB954296E4@apache.org> <4905F677.1020302@jasondavies.com> <4905F6A6.7060806@jasondavies.com> X-Google-Sender-Auth: 074f5c2f97572045 X-Virus-Checked: Checked by ClamAV on apache.org On Mon, Oct 27, 2008 at 10:51 AM, Ben Nevile wrote: > Thanks Jason. One further clarification, re "If you set the *update* option > to*false*, CouchDB will not perform any refreshing on the view that may be > necessary." > Does this mean that if I only call the view with update=false, the view > index will never be updated? > > Ben The update=false behavior is complicated by some implementation details. Oh, and the feature is currently not available in trunk, but is under active development. The upshot is that update=false will be useful for reducing latency in queries against a database that has a lot of writes going into it. However, it's not a guarantee that the no updating will be triggered, nor does it guarantee that results will be returned immediately. For that reason, the name might be misleading, but let's wait til the implementation is done to reconsider the name. Implementation details: update=false queries the latest available version of a completed view index. This means that if the view has not been built yet, there will not be an available completed index, and the index will be built before running the query. Also, in the case of a freshly booted server, there may not be a pointer to the last completed index, so we end up running an update then as well. For various reasons, partially completed indexes are not viable for queries. There are a lot of people who'd like a progress-bar on view computation. It is possible that we'll make available something like update=status, which could tell users roughly how many docs have been mapped, vs how many docs there are total, which would give an approximate measure of progress. Chris -- Chris Anderson http://jchris.mfdz.com