X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id EC32452D91 for ; Fri, 6 May 2005 03:51:37 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 52446-10 for ; Fri, 6 May 2005 06:51:29 +0000 (GMT) Received: from flake.decibel.org (flake.decibel.org [67.100.216.10]) by svr1.postgresql.org (Postfix) with ESMTP id 14AF152C7A for ; Fri, 6 May 2005 03:51:28 -0300 (ADT) Received: by flake.decibel.org (Postfix, from userid 1001) id 8BF611522D; Fri, 6 May 2005 01:51:29 -0500 (CDT) Date: Fri, 6 May 2005 01:51:29 -0500 From: "Jim C. Nasby" To: Tom Lane Cc: Christopher Kings-Lynne , David Roussel , Mischa Sandberg , pgsql-perform Subject: Re: COPY vs INSERT Message-ID: <20050506065129.GL88920@decibel.org> References: <21154.1115136741@sss.pgh.pa.us> <1115146397.4277c89dc37b4@webmail.telus.net> <1115246490.1709.233393619@webmail.messagingengine.com> <42797C1A.3090303@familyhealth.com.au> <16747.1115259776@sss.pgh.pa.us> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <16747.1115259776@sss.pgh.pa.us> X-Operating-System: FreeBSD 4.11-RELEASE i386 X-Distributed: Join the Effort! http://www.distributed.net User-Agent: Mutt/1.5.8i X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.008 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200505/53 X-Sequence-Number: 12217 On Wed, May 04, 2005 at 10:22:56PM -0400, Tom Lane wrote: > Also, there is a whole lot of one-time-per-statement overhead that can > be amortized across many rows instead of only one. Stuff like opening > the target table, looking up the per-column I/O conversion functions, > identifying trigger functions if any, yadda yadda. It's not *that* > expensive, but compared to an operation as small as inserting a single > row, it's significant. Has thought been given to supporting inserting multiple rows in a single insert? DB2 supported: INSERT INTO table VALUES( (1,2,3), (4,5,6), (7,8,9) ); I'm not sure how standard that is or if other databases support it. -- Jim C. Nasby, Database Consultant decibel@decibel.org Give your computer some brain candy! www.distributed.net Team #1828 Windows: "Where do you want to go today?" Linux: "Where do you want to go tomorrow?" FreeBSD: "Are you guys coming, or what?"