Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 14721 invoked from network); 19 Apr 2009 16:34:13 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 19 Apr 2009 16:34:13 -0000 Received: (qmail 46951 invoked by uid 500); 19 Apr 2009 16:34:11 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 46859 invoked by uid 500); 19 Apr 2009 16:34:11 -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 46849 invoked by uid 99); 19 Apr 2009 16:34:11 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 19 Apr 2009 16:34:11 +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 wout.mertens@gmail.com designates 209.85.219.166 as permitted sender) Received: from [209.85.219.166] (HELO mail-ew0-f166.google.com) (209.85.219.166) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 19 Apr 2009 16:34:02 +0000 Received: by ewy10 with SMTP id 10so1638127ewy.11 for ; Sun, 19 Apr 2009 09:33:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=vNRLwQ7Sx0lThOWPEE5iYSQWVt6ISG8/cnIfK7AZgZY=; b=nHg55KmCGzcD8WvpVl1Csh2E5DN51i2vFDBeK/KHLghpph1pPDsC3Z+1bXTaNpGsRH ppaq+ri/0PlcWdSp6L1FqG9WXNtEtLsGSktRpttQFNJSYqvVzILcWZYC1wYtK+6PYARX 9h3jtit6ZY0+S3X1dbwTXRlUV95DpKCPM/3dM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=vnGdM/iI9RkrbAUOUmDtH7jXbR/hyqmp8G3oYuDFsWOdH+WiitX2YFqA7BWtWxGTcL VP6nv4fO8+JHRKwuC0eJXDmSdF5Yyt1H7cQQYigbhK3GnjjjJNTgqaYYY3Rd9pLfg1Sv LobISnfSu5jcq3NDFiy/ejepAhShfHcZfQNWk= Received: by 10.210.144.3 with SMTP id r3mr2768110ebd.77.1240158822227; Sun, 19 Apr 2009 09:33:42 -0700 (PDT) Received: from ?91.86.254.164? ([91.86.254.164]) by mx.google.com with ESMTPS id 28sm1017342eyg.26.2009.04.19.09.33.39 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 19 Apr 2009 09:33:40 -0700 (PDT) Message-Id: From: Wout Mertens To: user@couchdb.apache.org In-Reply-To: <4a29064f0904190456m124fc8den42fb55fa62c19068@mail.gmail.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v930.3) Subject: Re: Is speed falls on dynamic views? Date: Sun, 19 Apr 2009 18:33:35 +0200 References: <4a29064f0904190456m124fc8den42fb55fa62c19068@mail.gmail.com> X-Mailer: Apple Mail (2.930.3) X-Virus-Checked: Checked by ClamAV on apache.org On Apr 19, 2009, at 1:56 PM, Elf wrote: > So, i have something like in view: > > if (doc.date_check < (new Date().getTime()/1000 - 2*60*60)) { > emit('not checked', 1); > } > > As I understand, it's impossible to cache this view results, so this > view must be recounted on every call. > Am i right? No. This view will be calculated once and then the result is what it was until the document is changed and the view recalculated. > Is there better idea to get document-level locking? Instead of "moving the view" you should "move the viewer". You should make a view showing only documents that are being worked on and emit the time at which work started. You can then get that view ordered in reverse, with the startkey set to to the time before which document processing should be retried. Wout.