Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 88954 invoked from network); 11 Feb 2009 21:54:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 Feb 2009 21:54:11 -0000 Received: (qmail 87187 invoked by uid 500); 11 Feb 2009 21:54:09 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 87140 invoked by uid 500); 11 Feb 2009 21:54:08 -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 87129 invoked by uid 99); 11 Feb 2009 21:54:08 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Feb 2009 13:54:08 -0800 X-ASF-Spam-Status: No, hits=3.4 required=10.0 tests=HTML_MESSAGE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [74.125.46.30] (HELO yw-out-2324.google.com) (74.125.46.30) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Feb 2009 21:54:02 +0000 Received: by yw-out-2324.google.com with SMTP id 2so208939ywt.5 for ; Wed, 11 Feb 2009 13:53:39 -0800 (PST) MIME-Version: 1.0 Received: by 10.150.51.6 with SMTP id y6mr302038yby.28.1234389219836; Wed, 11 Feb 2009 13:53:39 -0800 (PST) In-Reply-To: <572D0890-3DA8-4AE4-AB9F-54EA200E747A@apache.org> References: <7db9abd30902111022i6c7f6385n23beba458565afb@mail.gmail.com> <58546136-8137-45D1-A3EF-D9226C6B26F0@cisco.com> <572D0890-3DA8-4AE4-AB9F-54EA200E747A@apache.org> Date: Wed, 11 Feb 2009 16:53:39 -0500 Message-ID: <64a10fff0902111353g39026166sc5abcccd6e83e60b@mail.gmail.com> Subject: Re: [user] Thoughts on document/views... From: Dean Landolt To: user@couchdb.apache.org Content-Type: multipart/alternative; boundary=000e0cd6ae7af683c80462aba248 X-Virus-Checked: Checked by ClamAV on apache.org --000e0cd6ae7af683c80462aba248 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On Wed, Feb 11, 2009 at 4:45 PM, Damien Katz wrote: > > On Feb 11, 2009, at 4:29 PM, Chris Anderson wrote: > > On Wed, Feb 11, 2009 at 10:28 AM, Wout Mertens >> wrote: >> >>> On Feb 11, 2009, at 7:22 PM, kowsik wrote: >>> >>> >>>> What I'm getting at is, does it make sense to have some type of >>>> document "class" attribute and then have views bound to these classes? >>>> The goal, of course, being that couch-db can pre-filter a lot of these >>>> things and only run the views for the appropriate types of documents. >>>> >>> >>> I'm probably speaking before my turn being such a newbie, but why >>> wouldn't >>> you create a new database for disjoint classes of documents? >>> >> >> That's the basic rule of thumb: Document only need to be in the same >> database with each other, if they need to be run through the same >> views (or they need to be replicated together). >> >> If you have a db with millions of records, but only a handful of them >> are interesting to to your views, you will save a lot of serialization >> by putting the viewed documents in their own database. >> >> >>> Also, once a view is run on a document, it doesn't get re-run that often >>> does it? >>> >> >> Views are run one per document update, so if you write the document >> once, it only gets run through the view server once. >> >> If you have say, 5 different document "classes" and you have views >> that care about each of them, if you put those views in the same >> design document, then you will not have extra serialization hits. Each >> document update is sent to the view server once per design document. >> >> >>> So other than eating diskspace, maybe there's not really anything wrong >>> with >>> keeping everything in one db. >>> >> >> My recommendation is to not worry about it, unless you have like 75% >> or more docs that don't show up in any view. In that case, those docs >> might better off in another database. >> > > I agree with Chris. The way view indexes are updated en-masse, it makes > this mostly a non-issue. Antony did bring up an interesting (perhaps inevitable) optimization though -- in light of jchris' comments the guards won't do much good, but it'd make an interesting (post 1.0, obviously) addition to the erlang api to be able bypass view server i/o and json roundtripping. I probably wouldn't ever need it, and at first I'd gag a little when I cracked open someone else's erlang design doc, but it could lower the penalty for having a number of boutique third-party design docs in a database. --000e0cd6ae7af683c80462aba248--