Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 97825 invoked from network); 11 Feb 2009 18:38:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 Feb 2009 18:38:12 -0000 Received: (qmail 85083 invoked by uid 500); 11 Feb 2009 18:38:12 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 84670 invoked by uid 500); 11 Feb 2009 18:38:10 -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 84659 invoked by uid 99); 11 Feb 2009 18:38:10 -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 10:38:10 -0800 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 paul.joseph.davis@gmail.com designates 74.125.44.28 as permitted sender) Received: from [74.125.44.28] (HELO yx-out-2324.google.com) (74.125.44.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Feb 2009 18:38:04 +0000 Received: by yx-out-2324.google.com with SMTP id 31so156214yxl.5 for ; Wed, 11 Feb 2009 10:37:43 -0800 (PST) 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=h0ClRU3p85yq7RUMMnsjJMqUDmBrJn5MgMh1fDHTmdc=; b=kCGr9pKy2oU3y56cJM6Tkv4uO0zytxL7w6chTVFbpoIPdo6OZThPzvwDB2s82vKp5Z hQzwpnVSYd468PyTFham3oEwBLMch+jeU1mT+KWWw5kN9UPC31u64rodyiuP6eYHHczE 1UaUjPbAsWchlRwxadtiNUhclbpty9jSV4Rcs= 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=rHjCWkLWvVQDpV3n9zlsmj+jezlhtY7ywjqEYQfFQl2uz94pt/bbyBFbvXk6AA24IM uGOZq2+HCmkYPuH5SXtB2UxNZNweNr/20hWbomI7KsQUAMa8XfCkCbTeo1AsjiebD42+ +hakpAbLBlZVgqACi0Y40XxyPLcrc4vGWg2MI= MIME-Version: 1.0 Received: by 10.100.174.13 with SMTP id w13mr1384004ane.123.1234377463625; Wed, 11 Feb 2009 10:37:43 -0800 (PST) In-Reply-To: <7db9abd30902111022i6c7f6385n23beba458565afb@mail.gmail.com> References: <7db9abd30902111022i6c7f6385n23beba458565afb@mail.gmail.com> Date: Wed, 11 Feb 2009 13:37:39 -0500 Message-ID: Subject: Re: Thoughts on document/views... From: Paul Davis To: user@couchdb.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org On Wed, Feb 11, 2009 at 1:22 PM, kowsik wrote: > Just something that occurred to me and wanted to run it by you guys. > For pcapr, I have a number of different types of documents in > couch-db, some are comments, some are about the packets, etc. Now, I > have views that do something like this: > > map: function(doc) { > if (doc.type == 'comment') emit(...); > } > > With a large set of documents and a large set of views, any new > document or updates to document is passed to __all__ of the views > (when the view is eventually invoked). But I "know" that my documents > come in classes and that only certain views really apply to them. I'm > thinking of a view as a static method on a class that gets some > information about the instances. > That's an interesting way to think about views I'd never considered before. > 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. > > Thoughts? > > K. > My first impression is that the idea makes perfect sense but sounds like premature optimization. HTH, Paul Davis