incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Stockton <>
Subject Re: Views - Finding the column count for a given "table"
Date Tue, 13 Apr 2010 18:17:26 GMT

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,


View raw message