Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 43772 invoked from network); 13 Apr 2010 18:17:57 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 13 Apr 2010 18:17:57 -0000 Received: (qmail 38277 invoked by uid 500); 13 Apr 2010 18:17:55 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 38250 invoked by uid 500); 13 Apr 2010 18:17:55 -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 38242 invoked by uid 99); 13 Apr 2010 18:17:55 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Apr 2010 18:17:55 +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 chrisstocktonaz@gmail.com designates 209.85.223.171 as permitted sender) Received: from [209.85.223.171] (HELO mail-iw0-f171.google.com) (209.85.223.171) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Apr 2010 18:17:47 +0000 Received: by iwn1 with SMTP id 1so2755312iwn.27 for ; Tue, 13 Apr 2010 11:17:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:received:message-id:subject:from:to:content-type; bh=fG5IB48Xs/lW9/MMk8x/TnfkL78qidbj7zDQe6fnX1M=; b=IyIAP3WR0fYiDGgZdsnxEm+DIhH1g9SNcYX5MS25jiFURnARaNlSAGJNOi7Y7w8S17 A3nQNxW/2fgnX8gE81n5WtcPOQzgFaulfWwm/Fc06hznzXy2PwDFaxsVoYZmWvr6YxRh QKwM2eQdi8FnMohujY2mzrVzECtq9VmI0lmrk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=sCTXqb1Bv0KMyYardSmDCGNT2ijkH3fVWUBrY/x+EYOBAdPZlxWFZZ3Dlro8de2UFr /4Rk+MEWFfsGP8aU0XxjNEPBogi5RsvOZUcmBcWM+XxbgTHI+nGkZRmwNfaPlks39wdY PnhGZdtYo7N+oc61LRno60iJT4iWEo0FV1m9Q= MIME-Version: 1.0 Received: by 10.142.185.3 with HTTP; Tue, 13 Apr 2010 11:17:26 -0700 (PDT) In-Reply-To: References: Date: Tue, 13 Apr 2010 11:17:26 -0700 Received: by 10.142.250.21 with SMTP id x21mr2646158wfh.263.1271182646561; Tue, 13 Apr 2010 11:17:26 -0700 (PDT) Message-ID: Subject: Re: Views - Finding the column count for a given "table" From: Chris Stockton To: user@couchdb.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org Hello, On Tue, Apr 13, 2010 at 10:28 AM, J Chris Anderson wrote: > > This looks right to me. > > You might try replacing the reduce function with the simple text: > > _count > > which will do the equivalent reduce in Erlang (which will be much faster). Can you see if that helps? Thank you much for your response, your confirmation that my reduce looked correct led me to check other avenues and solve my issue. The getCountByTableColumn view works hand and hand with getByTableColumnValues for sorting. Turns out my substr call was sometimes being called on NULL in the getByTableColumnValues. This would raise a exception and fail to index those rows. This happens very rarely as we do not usually have null rows, since getByTableColumnValues returned a different number of rows then my getCountByTableColumn call it made me think the counting was incorrect. Fun times! Kind Regards, -Chris