Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 253E3634CE5 for ; Tue, 25 May 2010 05:16:21 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 11955-06 for ; Tue, 25 May 2010 08:16:13 +0000 (UTC) X-Greylist: delayed 00:16:14.916977 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 5D794632C8B for ; Tue, 25 May 2010 05:16:14 -0300 (ADT) Received: from [78.46.5.203] (helo=sslproxy01.your-server.de) by www64.your-server.de with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1OGp3N-00007I-El for pgsql-performance@postgresql.org; Tue, 25 May 2010 09:59:57 +0200 Received: from [217.89.104.238] (helo=lisa.local.iathh.de) by sslproxy01.your-server.de with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1OGpWP-0002Zc-IZ for pgsql-performance@postgresql.org; Tue, 25 May 2010 10:29:57 +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); Tue, 25 May 2010 09:59:49 +0200 Message-ID: <4BFB837C.6010005@iathh.de> Date: Tue, 25 May 2010 09:59:56 +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: pgsql-performance@postgresql.org Subject: performance of temporary vs. regular tables Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Authenticated-Sender: office@iathh.de X-Virus-Scanned: Clear (ClamAV 0.96/11075/Tue May 25 01:21:58 2010) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.185 tagged_above=-10 required=5 tests=BAYES_05=-0.5, SARE_MILLIONSOF=0.315 X-Spam-Level: X-Archive-Number: 201005/165 X-Sequence-Number: 38749 Greetings, in http://archives.postgresql.org/message-id/1056648218.7041.11.camel@jester, it is stated that the performance of temporary tables is "the same as a regular table but without WAL on the table contents.". I have a datamining-type application which makes heavy use of temporary tables to stage (potentially large amounts of) data between different operations. WAL is write-ahead To effectively multi-thread this application, I (think I) need to switch from temporary to regular tables, because - the concurrent threads need to use different connections, not cursors, to effectively operate concurrently - temporary tables are not visible across connections (as they are across cursors of the same connection) Thus, I wonder how much this will affect performance. Access on the temporary table is inserting (millions of) rows once in a single transaction, potentially update them all once within a single transaction, then select on them once or more. Of course, eventually loosing the data in these tables is not a problem at all. The threads are synchronized above the SQL level. Thanks for any input on how to maximize performance for this applicaiton. Joachim