couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Shorin <kxe...@gmail.com>
Subject Re: Is it possible to really "reduce" the output of a reduce?
Date Wed, 25 Mar 2015 20:05:11 GMT
Why not to make a view which doesn't emits keys with null values?
--
,,,^..^,,,


On Wed, Mar 25, 2015 at 10:49 PM, Russell McOrmond
<Russell.McOrmond@canadiana.ca> wrote:
>
>   This is a beginner question from someone who only installed CouchDB a
> few weeks ago.
>
>   What I'm trying to do may be simple, but the current way I'm doing it
> is extremely slow.   I have a view where after the work done by the
> reduce, most of the keys have no value and I would like to skip them.
> Out of hundreds of thousands of keys, there is more often less than a
> hundred keys that actually have a value.  (When I don't return anything,
> which shows up as a "null" value).
>
>   Currently I have a _list which loops through all the values and skips
> all the null's.  This takes quite a bit of processing time to go through
> hundreds of thousands of nulls to find the few that are not null.
>
>   Ideal is if the b-tree that my view created simply didn't include the
> keys where the value is null.   Is this possible?  IE: Is it possible to
> do an "emit" like thing rather than "return" from the reduce function,
> and not include specific keys?
>
>
> Note: I've heard about chained map/reduce that might solve this problem,
> but hoping there is a shorter term solution that doesn't involve moving
> away from CouchDB as we've invested a fair bit of time learning CouchDB
> already.
>
> --
> Lead Systems Engineer, Canadiana.org   http://www.canadiana.ca

Mime
View raw message