Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id E783D9FB39D for ; Tue, 24 Oct 2006 21:15:06 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 75791-08 for ; Tue, 24 Oct 2006 21:14:57 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from noel.decibel.org (noel.decibel.org [67.100.216.10]) by postgresql.org (Postfix) with ESMTP id A6B199FB2F3 for ; Tue, 24 Oct 2006 21:14:56 -0300 (ADT) Received: by noel.decibel.org (Postfix, from userid 1001) id 6C1A856423; Tue, 24 Oct 2006 19:14:55 -0500 (CDT) Received: (hashcash-sendmail, from uid 1001); Tue, 24 Oct 2006 19:14:49 -0500 Date: Tue, 24 Oct 2006 19:14:49 -0500 From: "Jim C. Nasby" To: "Craig A. James" , g@nasby.net Cc: Worky Workerson , Merlin Moncure , pgsql-performance@postgresql.org Subject: Re: Best COPY Performance Message-ID: <20061025001448.GZ26892@nasby.net> References: <20061023215913.GW26892@nasby.net> <453D443B.20302@modgraph-usa.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <453D443B.20302@modgraph-usa.com> X-Operating-System: FreeBSD 6.1-RELEASE-p10 amd64 X-Distributed: Join the Effort! http://www.distributed.net User-Agent: Mutt/1.5.13 (2006-08-11) X-Hashcash: 1:20:061025:cjames@modgraph-usa.com::tRAVXyPHo1ZOsJis:00000000000000 0000000000000000000000002Hdm X-Hashcash: 1:20:061025:g@nasby.net::oGYxi6Sg4zAiyeG+:0000002A13 X-Hashcash: 1:20:061025:worky.workerson@gmail.com::7XUzFkKjnk62zc2e:000000000000 000000000000000000000000B5xH X-Hashcash: 1:20:061025:mmoncure@gmail.com::VJUBgIJbEbTGB+eW:0000000000000000000 0000000000000000000000003WvY X-Hashcash: 1:20:061025:pgsql-performance@postgresql.org::kX+hB95R/vSaKF8J:00000 0000000000000000000000006Y2o X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.075 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200610/504 X-Sequence-Number: 21633 On Mon, Oct 23, 2006 at 03:37:47PM -0700, Craig A. James wrote: > Jim C. Nasby wrote: > >http://stats.distributed.net used to use a perl script to do some > >transformations before loading data into the database. IIRC, when we > >switched to using C we saw 100x improvement in speed, so I suspect that > >if you want performance perl isn't the way to go. I think you can > >compile perl into C, so maybe that would help some. > > I use Perl extensively, and have never seen a performance problem. I > suspect the perl-to-C "100x improvement" was due to some other factor, like > a slight change in the schema, indexes, or the fundamental way the client > (C vs Perl) handled the data during the transformation, or just plain bad > Perl code. > > Modern scripting languages like Perl and Python make programmers far, far > more productive than the bad old days of C/C++. Don't shoot yourself in > the foot by reverting to low-level languages like C/C++ until you've > exhausted all other possibilities. I only use C/C++ for intricate > scientific algorithms. > > In many cases, Perl is *faster* than C/C++ code that I write, because I > can't take the time (for example) to write the high-performance string > manipulation that have been fine-tuned and extensively optimized in Perl. Well, the code is all at http://cvs.distributed.net/viewcvs.cgi/stats-proc/hourly/ (see logmod directory and logmod_*.pl). There have been changes made to the C code since we changed over, but you can find the appropriate older versions in there. IIRC, nothing in the database changed when we went from perl to C (it's likely that was the *only* change that happened anywhere around that time). -- Jim Nasby jim@nasby.net EnterpriseDB http://enterprisedb.com 512.569.9461 (cell)