Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 33341 invoked from network); 21 Apr 2010 02:27:33 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 21 Apr 2010 02:27:33 -0000 Received: (qmail 45252 invoked by uid 500); 21 Apr 2010 02:27:32 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 45217 invoked by uid 500); 21 Apr 2010 02:27:32 -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 45209 invoked by uid 99); 21 Apr 2010 02:27:32 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 21 Apr 2010 02:27:32 +0000 X-ASF-Spam-Status: No, hits=0.1 required=10.0 tests=AWL,HTML_MESSAGE,HTML_OBFUSCATE_05_10,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [74.125.82.180] (HELO mail-wy0-f180.google.com) (74.125.82.180) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 21 Apr 2010 02:27:26 +0000 Received: by wyf22 with SMTP id 22so3700178wyf.11 for ; Tue, 20 Apr 2010 19:27:05 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.177.76 with HTTP; Tue, 20 Apr 2010 19:27:04 -0700 (PDT) In-Reply-To: References: Date: Tue, 20 Apr 2010 22:27:04 -0400 Received: by 10.216.85.135 with SMTP id u7mr629049wee.51.1271816824926; Tue, 20 Apr 2010 19:27:04 -0700 (PDT) Message-ID: Subject: Re: Intersecting several views From: Dean Landolt To: user@couchdb.apache.org Content-Type: multipart/alternative; boundary=0016e6d77c4511b2bf0484b5ee43 --0016e6d77c4511b2bf0484b5ee43 Content-Type: text/plain; charset=ISO-8859-1 On Tue, Apr 20, 2010 at 9:42 PM, Ning Tan wrote: > On Tue, Apr 20, 2010 at 9:08 PM, Nick Poulden wrote: > > My question is how to approach this filtering problem with couchdb. At > the > > moment I have different views on 'account_type', 'registration_date' and > > 'last_login_date'. My program queries each view separately and returns an > > intersection of the resulting key arrays. This is working ok while my > > database is small but it's not very scalable as all the document keys > have > > to be loaded in to memory before the intersection can happen. > > For these "ad hoc" queries, I would suggest a separate indexing system > (e.g. Couch-Lucene, etc). > > We use a Solr system for similar purposes. > Historically the solution to this problem has always been *run all your changes through something else*. I'm pretty down on that as an actual solution -- it's feasible but makes *something else* a pretty bigass bottleneck. Now you have to have a distributed *something else* and a distributed couch -- there's obvious benefits to a distributed couch but your *something else* is just serving up answers to specific ad-hoc questions... There's a pretty slick solution built into couch -- replication -- but the hard part is getting couch's replication to talk to your *something else*. I'm trying to fix that now, and it ought to be easy. I'll hit this list back once I get couch replication working on persevere 2.0 but the idea is all your couch _changes should be able to flow into some other defined store (mongo, lucene, sql, whatever) and from your couchapp (or anywhere else) you should be able to hit your *something else* to resolve multiterm queries. I'll post back in a few days but just wanted to jump in and point out that this kind of thing ought to be totally doable. --0016e6d77c4511b2bf0484b5ee43--