Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id AAA1B633B8B for ; Wed, 2 Jun 2010 09:54:39 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 62067-09 for ; Wed, 2 Jun 2010 12:54:31 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from www64.your-server.de (www64.your-server.de [213.133.104.64]) by mail.postgresql.org (Postfix) with ESMTP id 99AED6333FF for ; Wed, 2 Jun 2010 09:54:32 -0300 (ADT) Received: from [78.46.5.204] (helo=sslproxy02.your-server.de) by www64.your-server.de with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1OJnSo-0000SV-6S; Wed, 02 Jun 2010 14:54:30 +0200 Received: from [217.89.104.238] (helo=lisa.local.iathh.de) by sslproxy02.your-server.de with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1OJnpD-0007J8-J4; Wed, 02 Jun 2010 15:17:39 +0200 Received: from [10.22.0.6] ([10.22.0.6]) (authenticated user joachim.worringen@iathh.de) by lisa.local.iathh.de (Kerio MailServer 6.7.3 patch 1); Wed, 2 Jun 2010 14:54:22 +0200 Message-ID: <4C06547E.2010104@iathh.de> Date: Wed, 02 Jun 2010 14:54:22 +0200 From: Joachim Worringen Organization: IAT GmbH User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; de; rv:1.9.1.9) Gecko/20100317 Lightning/1.0b1 Thunderbird/3.0.4 MIME-Version: 1.0 To: Pierre C CC: pgsql-performance@postgresql.org Subject: Re: performance of temporary vs. regular tables References: <4BFB837C.6010005@iathh.de> <4BFB91A8.20805@iathh.de> <201005251241.59605.andres@anarazel.de> <4BFD4643.9010901@iathh.de> <4BFFA32D.8010009@iathh.de> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Authenticated-Sender: office@iathh.de X-Virus-Scanned: Clear (ClamAV 0.96/11120/Wed Jun 2 06:50:09 2010) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.8 tagged_above=-10 required=5 tests=BAYES_50=0.8 X-Spam-Level: X-Archive-Number: 201006/24 X-Sequence-Number: 38880 Am 02.06.2010 12:03, schrieb Pierre C: > Usually WAL causes a much larger performance hit than this. > > Since the following command : > > CREATE TABLE tmp AS SELECT n FROM generate_series(1,1000000) AS n > > which inserts 1M rows takes 1.6 seconds on my desktop, your 800k rows > INSERT taking more than 3 minutes is a bit suspicious unless : > > - you got huge fields that need TOASTing ; in this case TOAST > compression will eat a lot of CPU and you're benchmarking TOAST, not the > rest of the system > - you got some non-indexed foreign key > - some other reason ? Yes, the "other" reason is that I am not issueing a single SQL command, but import data from plain ASCII files through the Pyhton-based framework into the database. The difference between your measurement and my measurent is the upper potential of improvement for my system (which has, on the other hand, the advantage of being a bit more powerful and flexible than a single SQL statement....;-) ) Joachim