couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Davis <paul.joseph.da...@gmail.com>
Subject Re: 0.9 to 0.10 breaking changes
Date Fri, 28 Aug 2009 14:45:59 GMT
By default, reduce output must be less than half the size of it's
input when. Input and output data sizes are measured by the length of
their serialized JSON representations. This check is only made when
the length of the serialized output is greater than 200 characters.

HTH,
Paul Davis

On Fri, Aug 28, 2009 at 10:38 AM, Zachary
Zolton<zachary.zolton@gmail.com> wrote:
> So, if I've got this right, we're not really checking the "number of
> values for a key", but instead checking whether the size of the
> reduced JSON string representation is smaller than twice the size of
> the its input line of JSON.
>
> LOL there's got to less wordy version of that I could put into the wiki. Hmm...
>
> On Thu, Aug 27, 2009 at 5:26 PM, Chris Anderson<jchris@apache.org> wrote:
>> On Thu, Aug 27, 2009 at 12:13 PM, Paul Davis<paul.joseph.davis@gmail.com> wrote:
>>> On Thu, Aug 27, 2009 at 3:08 PM, Adam Wolff<awolff@gmail.com> wrote:
>>>> How is reduce size computed? Is it strictly number of bytes?
>>>> Thanks,
>>>> A
>>>
>>> The basic algorithm is:
>>>
>>> lenght1 = JSON.stringify(input).length;
>>> length2 = JSON.stringify(output).length
>>> if(enforce_reduce_limit && length2 > 200 && (length2 * 2)
> length1)
>>>    throw(reduce_overflow_error);
>>>
>>> Check line 49-55 or so in ./share/server/view.js
>>>
>>
>> There are a million ways this could be made more subtle. Also, as
>> mentioned on another thread, it'd be nice to have the 200 byte
>> threshold configurable, instead of just a boolean case.
>>
>> Chris
>>
>>
>> --
>> Chris Anderson
>> http://jchrisa.net
>> http://couch.io
>>
>

Mime
View raw message