couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simon Metson <>
Subject Re: Large key's in views
Date Wed, 11 Jul 2012 11:01:32 GMT
Hi Rory,  
I can't see why that would be a problem, I've certainly had views with 5-10 elements in the
key. I think you'd need to measure it to be sure though.  

On Wednesday, 11 July 2012 at 11:31, Rory Franklin wrote:

> We have a tree structure stored in Couch to mimic a filesystem, and I am trying to determine
the most efficient way to calculate storage amounts for any node (and below).
> As each leaf contains its path up to the root node, would it be bad form to emit out
the path with a value of the sum of the contained files within that node, considering that
node depth could be huge? (although in reality would rarely go more than 20 levels deep, more
often would be less than 10 levels)
> So it could look like this:
> emit(["6a1b6034bc634e3cf6865da4780c39eb", "d70c3dc615aaa3065e2edd4ecd9af74b", "6a1b6034bc634e3cf6865da4780c50ad"
…], 50030203)
> From there I can do a startkey/endkey query to get all nodes below a certain point and
do a reduce to get the total file size.
> My worry is that they emitted key being very large could be problematic, but I guess
this would only impact on how much storage the view will use on disk?
> Rory  

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