pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Bruno Wolff III <bruno@wolff.to>
Cc: Jim C. Nasby <decibel@decibel.org>
Cc: Christopher Kings-Lynne <chriskl@familyhealth.com.au>
Cc: David Roussel <pgsql-performance@diroussel.xsmail.com>
Cc: Mischa Sandberg <mischa.sandberg@telus.net>
Cc: pgsql-perform <pgsql-performance@postgresql.org>
Subject: Re: COPY vs INSERT
Date: Fri, 06 May 2005 09:51:55 -0400
Message-ID: <13782.1115387515@sss.pgh.pa.us> (raw)
In-Reply-To: <20050506123831.GA14417@wolff.to>
References: <OF93C70832.2AC188CE-ON85256FF6.0056B587-85256FF6.005774C2@us.ibm.com>
	<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>
	<20050506065129.GL88920@decibel.org>
	<20050506123831.GA14417@wolff.to>

Bruno Wolff III <bruno@wolff.to> writes:
>   "Jim C. Nasby" <decibel@decibel.org> wrote:
>> Has thought been given to supporting inserting multiple rows in a single
>> insert?

> It's on the TODO list. I don't remember anyone bringing this up for about
> a year now, so I doubt anyone is actively working on it.

It is on TODO but I think it is only there for standards compliance.
It won't produce near as much of a speedup as using COPY does ---
in particular, trying to put thousands of rows through at once with
such a command would probably be a horrible idea.  You'd still have
to pay the price of lexing/parsing, and there would also be considerable
flailing about with deducing the data type of the VALUES() construct.
(Per spec that can be used in SELECT FROM, not only in INSERT, and so
it's not clear to what extent we can use knowledge of the insert target
columns to avoid running the generic union-type-resolution algorithm for
each column of the VALUES() :-(.)  Add on the price of shoving an
enormous expression tree through the planner and executor, and it starts
to sound pretty grim.

			regards, tom lane



view thread (17+ messages)  latest in thread

Message-ID: <13782.1115387515@sss.pgh.pa.us>
Permalink:  ../13782.1115387515@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/13782.1115387515@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, bruno@wolff.to, decibel@decibel.org, chriskl@familyhealth.com.au, pgsql-performance@diroussel.xsmail.com, mischa.sandberg@telus.net
  Subject: Re: COPY vs INSERT
  In-Reply-To: <13782.1115387515@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox