Return-Path: Delivered-To: apmail-incubator-couchdb-user-archive@locus.apache.org Received: (qmail 97543 invoked from network); 22 Jul 2008 17:20:19 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 22 Jul 2008 17:20:19 -0000 Received: (qmail 29416 invoked by uid 500); 22 Jul 2008 17:20:18 -0000 Delivered-To: apmail-incubator-couchdb-user-archive@incubator.apache.org Received: (qmail 29382 invoked by uid 500); 22 Jul 2008 17:20:18 -0000 Mailing-List: contact couchdb-user-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: couchdb-user@incubator.apache.org Delivered-To: mailing list couchdb-user@incubator.apache.org Received: (qmail 29371 invoked by uid 99); 22 Jul 2008 17:20:18 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Jul 2008 10:20:18 -0700 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 sho.fukamachi@gmail.com designates 74.125.46.158 as permitted sender) Received: from [74.125.46.158] (HELO yw-out-1718.google.com) (74.125.46.158) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Jul 2008 17:19:23 +0000 Received: by yw-out-1718.google.com with SMTP id 5so871355ywr.0 for ; Tue, 22 Jul 2008 10:19:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:mime-version:subject:date:references :x-mailer; bh=crlpw2EabkUYi1l+H/82FoURU91t4TDTDyWqSnRxdi8=; b=iVtVoGt1NGAUw5ep5H7XN2G3KRYJtMdRGE3WmjTp8ar4oykiEmdHundG4LF+lDIm+k gl1+A9eG/+nScX55DcRHuXqdP3t+WvJaTsTzgWIwJnHSaPkdQJNPUqCU2l+8b1xkmWRe 3YE0wNZ1zwyrFHfSCf3Fi/qc2FxQsoZS7OBsU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type:mime-version:subject :date:references:x-mailer; b=v+uyNzPSxTczI5Ne9UVayc6lHnq0f5mddyVT5CeWHmVryQj6vTUp6rgWnSnnAwJasf ZMR+VLVI3zBsJ1dTUqcKeIFuMtW8UC/4q8ae7amu7ft4KWE2qskUqfRQamvLaxoQkhD4 qetErz+IFtArH4+THNPWD7g8uAqcImfsyypFE= Received: by 10.114.182.1 with SMTP id e1mr3991675waf.143.1216747187321; Tue, 22 Jul 2008 10:19:47 -0700 (PDT) Received: from ?10.1.1.8? ( [124.168.145.50]) by mx.google.com with ESMTPS id m27sm8434592pof.6.2008.07.22.10.19.44 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 22 Jul 2008 10:19:46 -0700 (PDT) Message-Id: <3F8F49C2-EC5C-4E6D-AFC9-854C42F7FC6D@gmail.com> From: Sho Fukamachi To: couchdb-user@incubator.apache.org In-Reply-To: <0EEE59DA-C752-43E0-A605-31865F6E020F@apache.org> Content-Type: multipart/signed; boundary=Apple-Mail-169-69290994; micalg=sha1; protocol="application/pkcs7-signature" Mime-Version: 1.0 (Apple Message framework v926) Subject: Re: when to use another document and when not to? Date: Wed, 23 Jul 2008 03:19:35 +1000 References: <6b6419750807141546q63431cfek69184295a1cb25b0@mail.gmail.com> <64a10fff0807141604i6f4c5778meba60a1f634f518b@mail.gmail.com> <4E5620A8-7ACD-4ADB-8FFD-424EEA289E21@apache.org> <6b6419750807141654x5b548706i1290367ca84acd27@mail.gmail.com> <66471514-BF70-4EFC-A258-CEC5C4799924@gmail.com> <0EEE59DA-C752-43E0-A605-31865F6E020F@apache.org> X-Mailer: Apple Mail (2.926) X-Virus-Checked: Checked by ClamAV on apache.org --Apple-Mail-169-69290994 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit On 23/07/2008, at 2:33 AM, Jan Lehnardt wrote: >> The outcome of the previous discussion on this thread seemed to be >> in favour of the use of a "followers" table which I thought was a >> pretty bad idea in CouchDB. I'd love to hear some defences of that, >> maybe someone can tell me what I'm missing... > > Your gut feeling was correct, it is a bad idea. Jan! I'd been hoping you'd comment. Care to elaborate a bit? I would really appreciate your insight! The simple situation is this: users can subscribe to other users. We need to be able to query in both directions - ie, starting with a known user, get the user records he is subscribed to - and the other direction, starting with a user, get the user records of those subscribed to him. I had actually been bending to the "followers" table a little, after doing some benchmarks and finding that 99% of the time just individually GET-ing the list of users (in either direction) from a list of IDs obtained from the followers table was going to be fast enough. I would *like* to place subscriptions in one or the other but just cannot think of how it is possible to write the views *in both directions* once it's stuck in a user, and I end up having to do the GET loop anyway. Would love to hear your views : ) Please let me know if I am not making any sense. Sho PS sorry all those who are sick of this thread .... > Cheers > Jan > -- --Apple-Mail-169-69290994 Content-Disposition: attachment; filename=smime.p7s Content-Type: application/pkcs7-signature; name=smime.p7s Content-Transfer-Encoding: base64 MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIGLzCCAugw ggJRoAMCAQICEBSIX9MtV1ZEa0RApBcv2rAwDQYJKoZIhvcNAQEFBQAwYjELMAkGA1UEBhMCWkEx JTAjBgNVBAoTHFRoYXd0ZSBDb25zdWx0aW5nIChQdHkpIEx0ZC4xLDAqBgNVBAMTI1RoYXd0ZSBQ ZXJzb25hbCBGcmVlbWFpbCBJc3N1aW5nIENBMB4XDTA3MTExODIzMTczNloXDTA4MTExNzIzMTcz NlowSTEfMB0GA1UEAxMWVGhhd3RlIEZyZWVtYWlsIE1lbWJlcjEmMCQGCSqGSIb3DQEJARYXc2hv LmZ1a2FtYWNoaUBnbWFpbC5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC4VztI LAmaS1WLCldsyC8eTG9bLMGvYEwRoJXYnyqJZPXMhQHdzAbw3V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