Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id AE4709FB1C6 for ; Mon, 23 Oct 2006 19:38:49 -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 47519-01 for ; Mon, 23 Oct 2006 19:38:35 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from 66-226-76-106.dedicated.abac.net (66-226-76-106.dedicated.abac.net [66.226.76.106]) by postgresql.org (Postfix) with ESMTP id 441FE9FA5C8 for ; Mon, 23 Oct 2006 19:38:34 -0300 (ADT) Received: (qmail 17675 invoked by uid 2020); 23 Oct 2006 15:39:57 -0700 Received: from wsip-70-167-125-69.sd.sd.cox.net (HELO ?192.168.0.3?) (70.167.125.69) by 66-226-76-106.dedicated.abac.net with (DHE-RSA-AES256-SHA encrypted) SMTP; 23 Oct 2006 15:39:57 -0700 Message-ID: <453D443B.20302@modgraph-usa.com> Date: Mon, 23 Oct 2006 15:37:47 -0700 From: "Craig A. James" User-Agent: Thunderbird 1.5.0.7 (X11/20060909) MIME-Version: 1.0 To: "Jim C. Nasby" CC: Worky Workerson , Merlin Moncure , pgsql-performance@postgresql.org Subject: Re: Best COPY Performance References: <20061023215913.GW26892@nasby.net> In-Reply-To: <20061023215913.GW26892@nasby.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=4.032 tagged_above=0 required=5 tests=AWL, HELO_DYNAMIC_IPADDR2, SPF_HELO_SOFTFAIL, SPF_SOFTFAIL X-Spam-Level: **** X-Archive-Number: 200610/496 X-Sequence-Number: 21625 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. Craig