Re: convert an Insert Into... select from... to use COPY ?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Kevin Kempter <kevink(at)consistentstate(dot)com>
Cc: "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: convert an Insert Into... select from... to use COPY ?
Date: 2009-07-16 21:08:34
Message-ID: 15580.1247778514@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Kevin Kempter <kevink(at)consistentstate(dot)com> writes:
> I have an sql stmt that runs:

> insert into x
> ( a.col1, a.col2, a.col3,b.col1,b.col2)
> select blah,blah,blah
> ...
> from giant_table a,
> even_bigger_table b
> where.....

> I wonder, could I convert this to use COPY into the table (x) instead of the
> select stmt?

Why would you want to? It's certain to be far slower.

regards, tom lane

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Kevin Grittner 2009-07-16 21:20:35 Re: Hard link / rsync backup strategy successful
Previous Message Kevin Grittner 2009-07-16 21:07:09 Re: Flush Shared Buffer Cache