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 DCFE49FF4 for ; Fri, 25 May 2012 15:17:46 +0000 (UTC) Received: (qmail 27298 invoked by uid 500); 25 May 2012 15:17:45 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 27266 invoked by uid 500); 25 May 2012 15:17:45 -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 27258 invoked by uid 99); 25 May 2012 15:17:45 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 25 May 2012 15:17:45 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of ladicek@gmail.com designates 209.85.214.180 as permitted sender) Received: from [209.85.214.180] (HELO mail-ob0-f180.google.com) (209.85.214.180) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 25 May 2012 15:17:37 +0000 Received: by obbun3 with SMTP id un3so1751949obb.11 for ; Fri, 25 May 2012 08:17:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=T8W55dY6YxajIsuQ8CQlgKaDqBB/c+IsVDrSB1XN6R0=; b=EhCQXg1AX7BKlVHXUfLwPgXXjrPlrCulJ3iqGWGYYSo5muqQMX3misLvaaWtKHL3OV AJpglmhsUwwNXIyoeb86YG7dLTu8sab+W1xYzpppD+3WS7xqfxXxEglDobq9fyVNeUT1 nGOanROPq0IVCpMXcAXCHJgSw1Ngnc2BNmlCtMM+ASKVQEwmpbMLB7IM/xffCY2soCxz ycVwfcnianRP9kSXAzk2PIMoRgYQtrClt3skLh/2w3igK8sfGXwmHk4vzfXwMycb0rMC 8AASxs+pcCjnJzCcUWxp6tCRyMxClneqe36gDgCpxg6fgj7HjdWhLyUNXHnOvvcQJPVQ hjmw== MIME-Version: 1.0 Received: by 10.182.18.136 with SMTP id w8mr3543235obd.38.1337959035883; Fri, 25 May 2012 08:17:15 -0700 (PDT) Received: by 10.182.76.70 with HTTP; Fri, 25 May 2012 08:17:15 -0700 (PDT) In-Reply-To: References: <08E52809-C962-4E9C-AFB8-397EA201580E@utt.fr> Date: Fri, 25 May 2012 17:17:15 +0200 Message-ID: Subject: Re: Am I doing something fundamentally wrong? From: Ladislav Thon To: user@couchdb.apache.org Content-Type: multipart/alternative; boundary=f46d043c7fc80ed0a904c0ddddaf --f46d043c7fc80ed0a904c0ddddaf Content-Type: text/plain; charset=ISO-8859-1 > > Clearly I seem to be a bit of a loan voice on this as everyone skirts > around the why do views take so long to build, why do they only run on one > CPU and why do they take up so much space I don't really understand CouchDB, so I'm not afraid to (try to) answer this and be (quite possibly) wrong :-) 1. "why do views take so long to build" -- because for every document, a JavaScript function has to be executed. This function is executed by a separate process (view server), in this case the "couchjs" process. As your documents are fairly large, this might incur significant serialization/deserialization overhead. Views can also be written in Erlang, AFAIK, and I bet that would be a hell of a lot faster. 2. "why do they only run on one CPU" -- because order of processing still matters here (to make incremental view updates possible), even if it is called "map reduce". It would surely be possible to write a parallel implementation, but it's more tricky than it looks on the first sight. Noone just did it yet. 3. " why do they take up so much space" -- because of CouchDB's append-only B-tree nature. Your views seem to have pretty random keys (as the keys are IDs of your documents), which means that a lot of inner nodes have to be created only to be discarded few moments later. Note that discarded here means that no pointer points at them, but they are still lying on the disk. All in all, I'd say that CouchDB isn't exactly great fit for an OLAP-style workload. LT --f46d043c7fc80ed0a904c0ddddaf--