Re: create table as select VS create table; insert as select

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: jacqui(dot)caren(at)ntlworld(dot)com
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: create table as select VS create table; insert as select
Date: 2010-10-29 14:25:49
Message-ID: 1079.1288362349@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Jacqui Caren-home <jacqui(dot)caren(at)ntlworld(dot)com> writes:
> I have inherited an application that populates a number of
> temp.y tables using create table ... as select ...
> As this process hammers the database, I can only run benchmarks at night so
> am asking here if anyone know if
> create table ...; then insert into ... as select... ; would be faster.

No, it'd likely be slower --- possibly quite a bit slower.

When you say "temp-y", do you mean these are in fact TEMP tables?
If not, can you make them be so? That would help.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2010-10-29 14:30:40 Re: pg_restore -t table doesn't restore PKEY
Previous Message Vick Khera 2010-10-29 14:21:14 Re: exceptionally large UPDATE