Skip site navigation (1) Skip section navigation (2)

Efficiency of CREATE TABLE AS

From: Brian Herlihy <btherl(at)yahoo(dot)com(dot)au>
To: pgsql-novice(at)postgresql(dot)org
Subject: Efficiency of CREATE TABLE AS
Date: 2007-05-09 05:34:10
Message-ID: 799123.3654.qm@web52303.mail.re2.yahoo.com (view raw or flat)
Thread:
Lists: pgsql-novice
Hi,

If I do the following

CREATE TABLE foo AS SELECT * FROM bar

and a sequential scan is chosen as the plan (in particular, no ordering required), will the rows be written directly into the new table?  I am concerned about the case where there may be many gigabytes of data being copied between these two tables.  And my precise concern is that the data may be stored temporarily before being placed in the new table, slowing things down.

Thanks,
Brian



Responses

pgsql-novice by date

Next:From: Tom LaneDate: 2007-05-09 05:57:31
Subject: Re: Efficiency of CREATE TABLE AS
Previous:From: Chamara GunaratneDate: 2007-05-09 01:38:05
Subject: Re: Disk and shared buffer cache use

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group