Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 6854 invoked from network); 17 Nov 2010 16:14:05 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 17 Nov 2010 16:14:05 -0000 Received: (qmail 87185 invoked by uid 500); 17 Nov 2010 16:14:34 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 87064 invoked by uid 500); 17 Nov 2010 16:14: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 87052 invoked by uid 99); 17 Nov 2010 16:14:31 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Nov 2010 16:14:31 +0000 X-ASF-Spam-Status: No, hits=0.9 required=10.0 tests=RCVD_NUMERIC_HELO,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of gcdcu-couchdb-user@m.gmane.org designates 80.91.229.12 as permitted sender) Received: from [80.91.229.12] (HELO lo.gmane.org) (80.91.229.12) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Nov 2010 16:14:23 +0000 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1PIke0-0001ND-4F for user@couchdb.apache.org; Wed, 17 Nov 2010 17:14:00 +0100 Received: from 77.107.84.74 ([77.107.84.74]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 17 Nov 2010 17:14:00 +0100 Received: from nicolas.jessus by 77.107.84.74 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 17 Nov 2010 17:14:00 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: user@couchdb.apache.org From: Nicolas Jessus Subject: Re: Forcing document reindex Date: Wed, 17 Nov 2010 16:13:47 +0000 (UTC) Lines: 31 Message-ID: References: <76A109FD-9829-4EAA-9BA1-0FAC29357EA9@apache.org> <7D7C2F35-4630-494D-BD39-C446FCB3486E@apache.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: sea.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 77.107.84.74 (Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.9.2.10) Gecko/20100915 Ubuntu/9.10 (karmic) Firefox/3.6.10) All right; no one should like what they're going to read. I have a medium-sized MySQL system, which translates to a Couch with about a million documents of about 20 types. The system would really benefit from a schema-free design. The data is only weakly relational. Couch would fit really well, enough that I don't mind twisting its arm in a few places if need be; the tradeoff would be worth it. The hiccup is reporting. Some of it involves the full set of documents. Let's say I have 5 categories of documents involved in a report, A to E. A links to B, B links to C, etc. The report needs data from A, B, and E. As far as I can think, there's no way to do a view collation, because A and B share an ID but E doesn't. I can't pull a million documents from the DB to process elsewhere either, so that nixes simple indexing and the '_id' object values. I could however write a special view_server that will emit keys after checking the linked ID through an HTTP call (that's where you scream). Indexing performance is totally unimportant to me, DB updates are relatively few, and I can live with the dirty side-effects (again, the system as a whole would still be much cleaner than the MySQL one). With that solution I can have a map function that just handle docs of type A. But I still need to reindex the relevant As when B or E changes. I could simply listen to the change stream and force a reindex, but that doesn't work well with legitimate updates when the _rev number goes up at random even though the doc hasn't changed, and there's no auto-merge. So I'm pretty stuck. I'm not asking that this type of functionality be encouraged. It's clearly subverting the point of Couch. On the other hand, it doesn't seem like having a force-reindex function would dirty the concept, and if it's easy to code, then it's a shame it doesn't exist.