Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 2896 invoked from network); 11 Feb 2009 18:49:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 Feb 2009 18:49:50 -0000 Received: (qmail 5823 invoked by uid 500); 11 Feb 2009 18:49:47 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 5780 invoked by uid 500); 11 Feb 2009 18:49:47 -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 5769 invoked by uid 99); 11 Feb 2009 18:49:47 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Feb 2009 10:49:47 -0800 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 paul.joseph.davis@gmail.com designates 74.125.44.30 as permitted sender) Received: from [74.125.44.30] (HELO yx-out-2324.google.com) (74.125.44.30) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Feb 2009 18:49:39 +0000 Received: by yx-out-2324.google.com with SMTP id 31so159013yxl.5 for ; Wed, 11 Feb 2009 10:49:18 -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=sGs5A6kNM7roboeQTuTKcHC3zKNYJR0CU6nau1VFCfQ=; b=AAulGLHTfDFWiEauOKng8cHluLT9PyhT3PJAsYOZrdX1QBAX39tl0/94PZitg8VM18 +3WcZBMAKsclLoxGE4+ehXHw9SnzpGOM0sV33KDDQN0/MyRYkZPtXdE8Gz7eJZHjocNb 4omLwyEVo/z7fPZpN5hj+ShrB22jERfbTqtSg= 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=QwDpvuN9OrQn4XSs78rUlKHekjmEwV0whZ2DFZAjWWffeKudXjVo3qcR4q40w3EzNJ 1z9snLs0k9yaxY+ic7uPaIkwlNJL8EaK2gWvc+JLpSRQfmDw2e/dxNl/ZkGJlo7kSBmR CTVmSGEeSxAy3ze3cE5Evr4X/Q6bp9WMI3uWc= MIME-Version: 1.0 Received: by 10.100.164.20 with SMTP id m20mr1659727ane.97.1234378150796; Wed, 11 Feb 2009 10:49:10 -0800 (PST) In-Reply-To: <58546136-8137-45D1-A3EF-D9226C6B26F0@cisco.com> References: <7db9abd30902111022i6c7f6385n23beba458565afb@mail.gmail.com> <58546136-8137-45D1-A3EF-D9226C6B26F0@cisco.com> Date: Wed, 11 Feb 2009 13:49:10 -0500 Message-ID: Subject: Re: [user] 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:28 PM, Wout Mertens wrote: > On Feb 11, 2009, at 7: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. >> >> 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? > > Also, once a view is run on a document, it doesn't get re-run that often > does it? > > So other than eating diskspace, maybe there's not really anything wrong with > keeping everything in one db. > > Wout. > > There's nothing at all wrong with keeping lots of multiple document types in a single database. 1 db != 1 table etc etc. When a view is rerun it is only executed once for each document that changed. It doesn't matter how many times the document changed either. HTH, Paul Davis