Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id AEFD59FBDE1 for ; Tue, 17 Jul 2007 17:58:06 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 32979-09 for ; Tue, 17 Jul 2007 17:58:04 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from pat.uio.no (pat.uio.no [129.240.10.15]) by postgresql.org (Postfix) with ESMTP id B11869FBB0B for ; Tue, 17 Jul 2007 17:58:03 -0300 (ADT) Received: from mail-mx9.uio.no ([129.240.10.39]) by pat.uio.no with esmtp (Exim 4.67) (envelope-from ) id 1IAu7O-0001GH-KK for pgsql-performance@postgresql.org; Tue, 17 Jul 2007 22:58:02 +0200 Received: from smtp.uio.no ([129.240.10.9] helo=mail-mx9.uio.no) by mail-mx9.uio.no with esmtp (Exim 4.67) (envelope-from ) id 1IAu7O-0004x9-7M for pgsql-performance@postgresql.org; Tue, 17 Jul 2007 22:58:02 +0200 Received: from 113.80-203-240.nextgentel.com ([80.203.240.113] helo=[10.0.0.128]) by mail-mx9.uio.no with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.67) (envelope-from ) id 1IAu7O-0004wz-0D for pgsql-performance@postgresql.org; Tue, 17 Jul 2007 22:58:02 +0200 Message-ID: <469D2D59.9030106@ifi.uio.no> Date: Tue, 17 Jul 2007 22:58:01 +0200 From: Thomas Finneid User-Agent: Thunderbird 1.5.0.12 (X11/20070604) MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Re: insert vs select into performance References: <469D1AD3.9030004@ifi.uio.no> <0D6011B2-D09F-45E8-A5D7-5F84ADD1DC2B@seespotcode.net> <5666.1184704280@sss.pgh.pa.us> In-Reply-To: <5666.1184704280@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-UiO-SPF-Received: X-UiO-Resend: resent X-UiO-SPF-Received: X-UiO-Spam-info: not spam, SpamAssassin (score=0.0, required=12.0, autolearn=disabled, none) X-UiO-Scanned: 8174EFD6874C2090434B20340589F448CAA9DFFD X-UiO-SPAM-Test: remote_host: 129.240.10.9 spam_score: 0 maxlevel 200 minaction 2 bait 0 mail/h: 456 total 2876990 max/h 8345 blacklist 0 greylist 0 ratelimit 0 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200707/195 X-Sequence-Number: 25879 Tom Lane wrote: > Michael Glaesemann writes: >> It would be helpful if you included the actual queries you're using, >> as there are a number of variables: > > Not to mention which PG version he's testing. Its pg 8.1, for now, I'll be upgrading to a compile optimised 8.2 when I do the real test on the real server. (its on kubuntu 6.10 running on a Thinkpad T60 with dual core 1.5,GB RAM and 100GB SATA, just in case anybody feels that is of any interrest.) > Since (I think) 8.1, > SELECT INTO knows that it can substitute one fsync for WAL-logging > the individual row inserts, since if there's a crash the new table > will disappear anyway. I am not sure I understand you correctly here, are you saying that SELECT INTO in 8.1 disables WAL logging and uses just a single fsync at the end? in that case it means that I could disable WAL as well and achieve the same performance, does it not? regards thomas