From user-return-13228-apmail-couchdb-user-archive=couchdb.apache.org@couchdb.apache.org Sat Oct 16 16:41:51 2010 Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 35820 invoked from network); 16 Oct 2010 16:41:51 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 16 Oct 2010 16:41:51 -0000 Received: (qmail 77238 invoked by uid 500); 16 Oct 2010 16:41:50 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 77128 invoked by uid 500); 16 Oct 2010 16:41:50 -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 77120 invoked by uid 99); 16 Oct 2010 16:41:49 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 16 Oct 2010 16:41:49 +0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of anandology@gmail.com designates 74.125.82.180 as permitted sender) Received: from [74.125.82.180] (HELO mail-wy0-f180.google.com) (74.125.82.180) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 16 Oct 2010 16:41:42 +0000 Received: by wye20 with SMTP id 20so895381wye.11 for ; Sat, 16 Oct 2010 09:41:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:content-type; bh=9lJ1recNKImdI2SXW5//njcG3TJ0xW7TzLO3gjZVASo=; b=MXq0h2EHsULKnciLATlMCn28w5NUCdbrqqkmx1gLIeAq5qoCcqEGsGXvDTF7QwlM6v uIrCnfl+QMT5G5H7pyXfCNW8Q+gZ2I0Pr48Yl8baJgTMo4xLQLMyvMRRDfI0iEXeD9dh 8vz/SLpI0eQ8f/uNu93asZ8ZTNufWiG/vwsyE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=bk28o5QjeJy9YUtI/m0TiAVt4gWac0eCSlwSfWt8ML6z5R01dh0kr8kkXwBeLvs69Y G2m4RVnX4HtkVoU0IX5jQ4e44aelkpaO2+fJ45r2tu4RBXSJ8mmRSBaGsmSS0iGFrOLR +if8crinWdddm/j36d5L7yeKYaVgbfcWRAwRM= Received: by 10.216.142.199 with SMTP id i49mr2293148wej.96.1287241503087; Sat, 16 Oct 2010 08:05:03 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.72.147 with HTTP; Sat, 16 Oct 2010 08:04:42 -0700 (PDT) In-Reply-To: <9FE98F86-B81E-4B5D-AEE9-07FF33ED201D@gmail.com> References: <9FE98F86-B81E-4B5D-AEE9-07FF33ED201D@gmail.com> From: Anand Chitipothu Date: Sat, 16 Oct 2010 20:34:42 +0530 Message-ID: Subject: Re: how to count the number of unique values To: user@couchdb.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org 2010/10/15 Wout Mertens : > Just wanted to add that if you have a map function that emits (tag, 1) for each tag and then a reduce function that's just _count, you will have everything you need for painting a tag cloud. > > The view with group=true will list all tags exactly once, with their count. CouchDB doesn't tell you how many rows are in the result so you'll have to count them yourself. > > So you load that entire view in memory and you can draw the tags with their relative sizes. > > Wout. The example I gave is a rather simplified example. I'm working a data containing 25M+ docs with books, works and subjects. I need to find the list/count of works for each subject. I don't think it is practical to load the view into memory to compute the required result. Anand