Return-Path: X-Original-To: apmail-couchdb-user-archive@www.apache.org Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9E8B0D655 for ; Wed, 11 Jul 2012 11:02:07 +0000 (UTC) Received: (qmail 82950 invoked by uid 500); 11 Jul 2012 11:02:06 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 82687 invoked by uid 500); 11 Jul 2012 11:02:05 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 82668 invoked by uid 99); 11 Jul 2012 11:02:04 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Jul 2012 11:02:04 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FSL_RCVD_USER,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of simon@cloudant.com designates 74.125.82.42 as permitted sender) Received: from [74.125.82.42] (HELO mail-wg0-f42.google.com) (74.125.82.42) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Jul 2012 11:01:55 +0000 Received: by wgbds11 with SMTP id ds11so4064178wgb.5 for ; Wed, 11 Jul 2012 04:01:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=date:from:to:message-id:in-reply-to:references:subject:x-mailer :mime-version:content-type:x-gm-message-state; bh=Hys0GAfpf9ZfOn5zz05HE4DnGpHWoRl58zoHNcJmvW0=; b=FQczLgnuUx0MgYMRhnno9XkvvOdk+FnmAKVb0ZgOvKC9ia3cgtayQjV0yo3u2ovJxs SdJXl8NDfnuN4Pl9m8Y4c7e1w2YB4xAOFcYLbB3XuLIeGN3IgD/GRhdX3u6vyMcK9aZX K3NssT+WY2tzQX2LdJ+xqBCW75t1i63ZpCEwD/kFtECoQgNoRbz3A++XpxjcVdPJTmy2 bLm8tD/gESu1tewe0aGzqrKuREAGwiHyvM2IVv1tH9PA4ZxMxsItJoriGqoS6+9BSv/b n6R39zjtTDSXegyfIjTRipBEX9z81h+zumsNs/VhfxE/NKOw/HVn7sTJvlz0pDul/c51 wVZQ== Received: by 10.216.133.133 with SMTP id q5mr4333110wei.139.1342004494633; Wed, 11 Jul 2012 04:01:34 -0700 (PDT) Received: from [192.168.1.73] (host109-157-135-188.range109-157.btcentralplus.com. [109.157.135.188]) by mx.google.com with ESMTPS id bu6sm4212339wib.8.2012.07.11.04.01.33 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 11 Jul 2012 04:01:33 -0700 (PDT) Date: Wed, 11 Jul 2012 12:01:32 +0100 From: Simon Metson To: user@couchdb.apache.org Message-ID: In-Reply-To: References: Subject: Re: Large key's in views X-Mailer: sparrow 1.6.1 (build 1081.52) MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="4ffd5d0c_6c89b896_92" X-Gm-Message-State: ALoCoQm/58mI3O2/iV3feQzm87Fyn1o6tDqEvWnbDfifQdPJ42pU7Lr8qnhwUbrYK1e3+QqJuZsR --4ffd5d0c_6c89b896_92 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi Rory, =20 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 thoug= h. =20 Cheers Simon On Wednesday, 11 July 2012 at 11:31, Rory =46ranklin wrote: > We have a tree structure stored in Couch to mimic a filesystem, and I a= m trying to determine the most efficient way to calculate storage amounts= for any node (and below). > =20 > As each leaf contains its path up to the root node, would it be bad for= m to emit out the path with a value of the sum of the contained files wit= hin that node, considering that node depth could be huge=3F (although in = reality would rarely go more than 20 levels deep, more often would be les= s than 10 levels) > =20 > So it could look like this: > =20 > emit(=5B=226a1b6034bc634e3cf6865da4780c39eb=22, =22d70c3dc615aaa3065e2e= dd4ecd9af74b=22, =226a1b6034bc634e3cf6865da4780c50ad=22 =E2=80=A6=5D, 500= 30203) > =20 > =46rom 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. > =20 > 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 us= e on disk=3F > =20 > =20 > =20 > =20 > Rory =20 --4ffd5d0c_6c89b896_92--