Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 65619 invoked from network); 18 Jun 2010 10:25:54 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 18 Jun 2010 10:25:54 -0000 Received: (qmail 11501 invoked by uid 500); 18 Jun 2010 10:25:53 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 11217 invoked by uid 500); 18 Jun 2010 10:25:49 -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 11209 invoked by uid 99); 18 Jun 2010 10:25:48 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 Jun 2010 10:25:48 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of faust451@gmail.com designates 74.125.78.25 as permitted sender) Received: from [74.125.78.25] (HELO ey-out-2122.google.com) (74.125.78.25) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 Jun 2010 10:25:43 +0000 Received: by ey-out-2122.google.com with SMTP id 22so146837eye.3 for ; Fri, 18 Jun 2010 03:25:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=R7ieeZXN+2yDS0Eb5FD63tKV6/hobE1U/K2B1EyKaOc=; b=WFdCNh+Dxr0pF2IVn/5hf2akwqLtlgLjVmNT1DgQni6Sg+zp0XmiuofM0SiR9svaHw xqzS6KoEhZXSKGk+PuEJKnXNfIYDaf2OTvUd7vv1MJUPJllDY6Vz5Z25WjusGvqW22KJ 5dTUKUje82IpYk0UFp2Sq8TKOZ7BOIC3tIKPk= 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=hdZnzijRiBTuJ8iKqaA9DsQ3ZMw7DohRMYND4XUZfnieyaFAqidUVu5BzpwBRj1KaW NdYeYq56jFsQebkTuG4FHn2WrzxNuwAPCveaRpvXXan77nvjvFCKmIOpWonWvtG0hseE VNjkDc44u53ghF9wrzw/bra7zMBkiSeS0rGbo= MIME-Version: 1.0 Received: by 10.213.29.65 with SMTP id p1mr1881309ebc.76.1276856720252; Fri, 18 Jun 2010 03:25:20 -0700 (PDT) Received: by 10.213.32.139 with HTTP; Fri, 18 Jun 2010 03:25:20 -0700 (PDT) In-Reply-To: References: <46ACF4F3-1F6C-40F6-95C5-4B9286890BBA@gmail.com> Date: Fri, 18 Jun 2010 14:25:20 +0400 Message-ID: Subject: Re: Need advice about docs structure design. From: faust 1111 To: user@couchdb.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Chris > views are processed in batch, so all functions in a design doc are calcul= ated together. What is mean? Example: i keep Bookmarks and Posts in same DB have two views: one fetch Bookmarks another fetch Posts when i called fetch Posts what happens? Posts view processed all new+updated docs Bookmarks view processed all new+updated docs > all functions in a design doc are calculated together. If i follow you, when i call one view others in design doc are re-calculate= too? is it right? Thanks! 2010/6/18 J Chris Anderson : > > On Jun 17, 2010, at 1:37 PM, faust 1111 wrote: > >> If i keep =A0them in the same database >> What about view speed? >> >> Example users add many bookmarks and when try fetch Posts each >> bookmark processed by this view but it's unnecessary it's slow down my >> views is not it?. >> > > views are processed in batch, so all functions in a design doc are calcul= ated together. so don't worry about having lots of views. > > still, it helps to keep views compact, so only emit what you need from ea= ch view, even if you have many views. (I break this rule all the time). > > mostly, relax about how to store it, and the just write whatever views ge= t you want you need. > > Chris > >> >> 2010/6/18 J Chris Anderson : >>> >>> On Jun 17, 2010, at 1:15 PM, faust 1111 wrote: >>> >>>> Hy guy's. >>>> >>>> My model: >>>> Users has >>>> =A0Bookmarks and Posts >>>> >>>> have idea keep Bookmarks and Posts in separate DB (for speed views). >>>> But in view i want fetch Bookmarks and Posts with user name, >>>> >>> >>> You should keep them in the same database (replication is easier, too) = and then use this kind of query: >>> >>> http://www.cmlenz.net/archives/2007/10/couchdb-joins >>> >>>> In what way i can do this? >>>> keep copy of users in each DB? >>>> >>>> or may be keep users in separate DB, fetch bookmarks or posts and then >>>> fetch users and then merge? >>>> >>>> Yes i know i can copy user name to doc, but have a trouble when user >>>> name is changed (it's force me use stale=3Dok in request view >>>> +background process to track changes and run rebuild index). >>>> >>>> I think it's will be cool crazy stuff if i can update docs(cached >>>> fields - not have effect to index) and say Couch you don't need >>>> rebuild index relax ;). >>>> >>>> Any advice? >>> >>> > >