From user-return-4481-apmail-couchdb-user-archive=couchdb.apache.org@couchdb.apache.org Sun Apr 19 18:05:03 2009 Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 47975 invoked from network); 19 Apr 2009 18:05:02 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 19 Apr 2009 18:05:02 -0000 Received: (qmail 7713 invoked by uid 500); 19 Apr 2009 18:05:01 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 7624 invoked by uid 500); 19 Apr 2009 18:05:01 -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 7607 invoked by uid 99); 19 Apr 2009 18:05:01 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 19 Apr 2009 18:05:01 +0000 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 elf2001@gmail.com designates 209.85.220.163 as permitted sender) Received: from [209.85.220.163] (HELO mail-fx0-f163.google.com) (209.85.220.163) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 19 Apr 2009 18:04:54 +0000 Received: by fxm7 with SMTP id 7so1829535fxm.11 for ; Sun, 19 Apr 2009 11:04:33 -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 :content-transfer-encoding; bh=xcagJDv35oTFgEvGsp1MNgWCmTO0q3IV/2aw56fOw+k=; b=HbFiuzxW4eIkyZT+SAq4Rw+opzKQqnk6hm8eQxpYZYOOTxU22qOvWgpT3H0NaQtmSk VJrC3zaKcqKz6ePekv7svAWE/ExH6PUEsKFhWeU+kdgS66lUeqALmSZvDHrJEcWeQa5D CwLn6G33xCH2m8U8kXLRO7xjyzW2Ele3YiqAU= 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:content-transfer-encoding; b=W6cI1MDZoxxR9m/CMRpzvS4ki2c938kanAPzppDMhoSgEBnvUGUxQk2fCQlL+e079q iEGHe5/+R39hJTIG9No3ggyTpO0M5xBqmWr48sIopquR4pj6y8b77pKk0E9thaWiaTwB /DEMidvV28mUYyl66wWs/JI47jCJM5N3DnC5I= MIME-Version: 1.0 Received: by 10.86.70.20 with SMTP id s20mr2560437fga.1.1240164273006; Sun, 19 Apr 2009 11:04:33 -0700 (PDT) In-Reply-To: <4C2E2147-6D84-48B2-AEE8-07FDCB6F60E5@gmail.com> References: <4a29064f0904190456m124fc8den42fb55fa62c19068@mail.gmail.com> <4a29064f0904191046p2e36f65fsee89bc2f45754981@mail.gmail.com> <4C2E2147-6D84-48B2-AEE8-07FDCB6F60E5@gmail.com> Date: Sun, 19 Apr 2009 21:04:32 +0300 Message-ID: <4a29064f0904191104v52099d0ew4ca9cdd66d8cdd8f@mail.gmail.com> Subject: Re: Is speed falls on dynamic views? From: Elf To: user@couchdb.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org 2009/4/19 Wout Mertens : > On Apr 19, 2009, at 7:46 PM, Elf wrote: > >> 2009/4/19 Wout Mertens : >>> >>> 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)) { >>>> =A0 =A0emit('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. >> >> So, only first view calculating will be correct (new Date() returns >> current date) and all next calls to this view will return incorrect >> rows (because of outdate new Date() value in a view)? > > Yup... View functions have to be such that given a view function f and 2 > documents x and y, that if x =3D=3D y then f(x) =3D=3D f(y). > Ok, I understand. I'll change program logick to adopt couchdb reality. CouchDB is amazing, but need to put upside down all i know before about databases... --=20 ---------------- Best regards Elf mailto:elf2001@gmail.com