Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 47686 invoked from network); 22 Oct 2009 15:13:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 22 Oct 2009 15:13:20 -0000 Received: (qmail 36344 invoked by uid 500); 22 Oct 2009 15:13:16 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 36308 invoked by uid 500); 22 Oct 2009 15:13:16 -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 36276 invoked by uid 99); 22 Oct 2009 15:13:16 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Oct 2009 15:13:16 +0000 X-ASF-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of paul.joseph.davis@gmail.com designates 209.85.217.211 as permitted sender) Received: from [209.85.217.211] (HELO mail-gx0-f211.google.com) (209.85.217.211) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Oct 2009 15:13:14 +0000 Received: by gxk3 with SMTP id 3so1534019gxk.15 for ; Thu, 22 Oct 2009 08:12:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=emJYVgxeGeChXPOT0Pg1baqghdXLE541BsmJ8cKMZ6k=; b=RhrtpCaCMTW4+tsyclDCr7a+MN/vw9IN0JFme/BesHXVJuO6hNRGzmZxmH90oaO3x/ 6+mtsLKXMBZf7+qBFRpdQXK6pn2NtGTOntECtHtg4S3nBPsTVdD4TdKCVJNSv+0RZF8G ySzlfButJoYLWABNcH6PjKPP9MfrlLCkUanH8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=RzUyNN2cNdP6obW1KooCn/rmkpUOmn3ccuTr6zqKnEfuN1fqRj1CpHwq0VwXL8r4Q7 cTp5Qh/p6L61Aue5UXV7SVx8aDY8qGX/LcPHOHT2Sf9a8G7r+uZ3hWs8w5aavbKVoqBQ gUidbEPsyum4HUres+zWMuI5yyDPIgKRbCvFE= MIME-Version: 1.0 Received: by 10.101.46.1 with SMTP id y1mr5703247anj.95.1256224373193; Thu, 22 Oct 2009 08:12:53 -0700 (PDT) In-Reply-To: <2fd53c3a0910220355i3bcbe880j385cf68e61cd570b@mail.gmail.com> References: <2fd53c3a0910220355i3bcbe880j385cf68e61cd570b@mail.gmail.com> From: Paul Davis Date: Thu, 22 Oct 2009 11:12:33 -0400 Message-ID: Subject: Re: re-index efficiency To: user@couchdb.apache.org Content-Type: text/plain; charset=ISO-8859-1 Fabio, There are about four things that will slow view generation down from the _bulk_docs rate: 1. JSON conversion (twice) when passing data to the view process 2. Collation of keys on tree insertion 3. I/O (Disk and stdio) 4. Memory thresholds Things like native views will give noticeable speed improvements because it avoids JSON serialization and transfer over stdio. The other (theoretically) tunable parameter is the memory threshold that triggers flushes to disk. Its not currently configurable by the client (requires a rebuild of couchdb) and as such I haven't seen anyone attempt to tune it. HTH, Paul Davis On Thu, Oct 22, 2009 at 6:55 AM, Fabio Forno wrote: > Hi, > not knowing the internals of couchdb I may ask stupid question, so > just ignore it if it's really stupid ;) > > Using it I've noticed the re-index times take a time which comparable > to the insertion off all the documents without using bulk inserts, > while with bulk inserts the insert ionof documents is much faster. > Instead in my idea, re-indexing should be as fast as fast bulk > inserts, since when computing an index we don't need to do many > fsyncs, but instead allow maximum caching before disk writes (with > berkeley db for example, sustained write of data exceeding the memory > cache are 100-1000x faster without syncs for each write). So, since I > don't think that this relative slowness is due to fsyncs which is the > main reason? (another hint which rules out fsyncs is that cpu is > rather high and not in waiting state) > > -- > Fabio Forno, > Bluendo srl http://www.bluendo.com > jabber id: ff@jabber.bluendo.com >