couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Jackson <>
Subject Hitting reduce_limit with "good" reduce function
Date Thu, 11 Apr 2013 18:06:39 GMT

I'm currently getting the "Reduce output must shrink more rapidly" error
with what I believe is a "good" reduce function. When I checked the
default.ini config file to tweak the reduce_limit setting, it told me to
ping the mailing list "so we can fine tune the heuristic", so here I am. :)

Without going too deep into the details of my app, I'm basically using my
reduce function to reduce a set of timestamps to the most recent one, and
then appending that value to another doc that I also pass in to the reduce
function. This is probably tripping the reduce_limit guard because the
result of the reduce is essentially the original document plus one extra
property. The thing is, I know that it will only ever add one extra
property, hence I know the reduce function is "good".

My use case is that I've got a bunch of user documents and a bunch of
timestamps of when we last saw that user. When I fetch the user doc, I'd
like to also have present the timestamp when that user was last seen. I may
just be greedy wanting to do this all in one query, but I'll be running
this query very frequently so I'd like to optimize this case.

Michael Jackson

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message