couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ryszard Szopa" <>
Subject separate rereduce component in view proposal
Date Mon, 23 Jun 2008 15:15:34 GMT
At present, the same function is used in both the reduce and rereduce
phase.The view-server is expected to inform the reduce function that
it is going to be a rereduce (in JS this is done by passing an
additional, third argument, in Common Lisp by setting a special
variable). Because of this all reduce functions (except the most
simple ones) have to start with testing in which phase they are and
depending on the result of this test behave completely differently (in
reduce they get keys and values; in rereduce they get just a list of

My proposition is to add an optional component to view objects,
"rereduce". This should be a function that taking a list (array) of
intermediate values and returning the result of rereducing it. If it
was present in the view, couchdb would pass it to the view-server in
the rereduce phase. Otherwise, "reduce" would be passed (as it is done

    -- Richard

View raw message