Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 9771 invoked from network); 31 May 2009 10:26:21 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 31 May 2009 10:26:21 -0000 Received: (qmail 71951 invoked by uid 500); 31 May 2009 10:26:32 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 71874 invoked by uid 500); 31 May 2009 10:26: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 71862 invoked by uid 99); 31 May 2009 10:26:32 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 31 May 2009 10:26:32 +0000 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: local policy) Received: from [152.66.245.200] (HELO leni.tmit.bme.hu) (152.66.245.200) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 31 May 2009 10:26:22 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by leni.tmit.bme.hu (Postfix) with ESMTP id B60114B981 for ; Sun, 31 May 2009 12:26:01 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at tmit.bme.hu Received: from leni.tmit.bme.hu ([127.0.0.1]) by localhost (leni.tmit.bme.hu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id uixQJHpkE6TZ for ; Sun, 31 May 2009 12:25:54 +0200 (CEST) Received: from anyo.tmit.bme.hu (anyo.tmit.bme.hu [152.66.246.7]) by leni.tmit.bme.hu (Postfix) with ESMTP for ; Sun, 31 May 2009 12:25:54 +0200 (CEST) Received: from [127.0.0.1] (zed@zed.tmit.bme.hu [152.66.244.226]) (authenticated bits=0) by anyo.tmit.bme.hu (8.13.8/8.13.8/Debian-3) with ESMTP id n4VAPrd7016308 for ; Sun, 31 May 2009 12:25:53 +0200 Message-ID: <4A225B26.80305@tmit.bme.hu> Date: Sun, 31 May 2009 12:25:42 +0200 From: Zoltan Lajos Kis User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) MIME-Version: 1.0 To: user@couchdb.apache.org Subject: Re: Many-to-many views sorted and paginated References: <4A22584F.6040008@tmit.bme.hu> In-Reply-To: <4A22584F.6040008@tmit.bme.hu> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Maciej Dziardziel wrote: > Zoltan Lajos Kis wrote: > >> I understand that if I stored registration data within event documents, >> e.g. by listing userid's, this would be as simple as emitting keys like >> [event.registered[i], event.date, event.location] and then querying with >> "?startkey=[userid]&endkey=[userid, {}]&limit=20" >> >> However, for me it seems more appropriate from several aspects not to >> store the registration data within the event documents. > > You could store those data in both places. Perhaps this is part of the things "to be unlearnt", but I still don't favor the idea of this kind of redundancy. Also it feels more natural to me to store registrations along with user data, as this way I only have single-writer documents and can limit write access on events. > > > >> 1. Using a view, which emits ( [event.date, event.location], event.id ), >> I get the list of all eventid's, properly sorted (without the >> documents). > > Depending on the number of events this can kill your perfomance - > downloading large amount of data (reading them first from disk) > looks for me like worst possible solution. > This was my fear as well... I may be able to introduce some restrictions, for example showing user events only for a given week / month. That way I can use a key-range for this view as well, limiting the ids to be emitted. Zoltan.