pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Craig A. James <cjames@modgraph-usa.com>
To: Jim C. Nasby <jim@nasby.net>
Cc: Worky Workerson <worky.workerson@gmail.com>
Cc: Merlin Moncure <mmoncure@gmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Best COPY Performance
Date: Wed, 25 Oct 2006 09:52:14 -0700
Message-ID: <453F963E.4010206@modgraph-usa.com> (raw)
In-Reply-To: <20061025152209.GP26892@nasby.net>
References: <ce4072df0610201305u7836dc7bn437ec0aaf1c3e25f@mail.gmail.com>
	<b42b73150610201811m84369f7kc7d58b39aed3ad73@mail.gmail.com>
	<ce4072df0610230810t5d66bbb8xf1e9c0ed71b6b6c0@mail.gmail.com>
	<20061023215913.GW26892@nasby.net>
	<ce4072df0610240617s72f35540odd3d4e0903313b63@mail.gmail.com>
	<20061025001709.GA26892@nasby.net>
	<453EF7C4.2040105@modgraph-usa.com>
	<20061025152209.GP26892@nasby.net>

Jim C. Nasby wrote:
> Wait... so you're using perl to copy data between two tables? And using
> a cursor to boot? I can't think of any way that could be more
> inefficient...
> 
> What's wrong with a plain old INSERT INTO ... SELECT? Or if you really
> need to break it into multiple transaction blocks, at least don't
> shuffle the data from the database into perl and then back into the
> database; do an INSERT INTO ... SELECT with that same where clause.

The data are on two different computers, and I do processing of the data as it passes through the application.  Otherwise, the INSERT INTO ... SELECT is my first choice.

Craig



view thread (52+ messages)  latest in thread

Message-ID: <453F963E.4010206@modgraph-usa.com>
Permalink:  ../453F963E.4010206@modgraph-usa.com/
Also on:    postgresql.org/message-id/453F963E.4010206@modgraph-usa.com

 · 

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: cjames@modgraph-usa.com, jim@nasby.net, worky.workerson@gmail.com, mmoncure@gmail.com
  Subject: Re: Best COPY Performance
  In-Reply-To: <453F963E.4010206@modgraph-usa.com>

* 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