> On Sep 3, 2014, at 12:51 PM, Guilherme Andrade <[email protected]> wrote: > > Maybe by finding some reliable / good-enough way to calculate an > arbitrary document's disk size
It's not hard to walk a JSON object recursively and compute how many bytes it would probably occupy as JSON. Then you'd need to add in the encoded_length of each attachment. But after that you run into implementation details like: are document bodies stored using some kind of compression (like Snappy)? Are they even stored as JSON at all, vs. serialized Erlang terms? And what about conflicts — if a doc is in conflict, you really need to add up the size of each conflicting revision, but IIRC you can't access the other revisions from a map function. —Jens
