couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rory Franklin <>
Subject Large key's in views
Date Wed, 11 Jul 2012 10:31:27 GMT
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?

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