Preferred usage for 'copy to' for a subset of data - Mailing list pgsql-general

From Jason L. Buberel
Subject Preferred usage for 'copy to' for a subset of data
Date
Msg-id 46EA12FB.8080507@buberel.org
Whole thread Raw
Responses Re: Preferred usage for 'copy to' for a subset of data
List pgsql-general
For recent postgres releases, is there any effective difference (performance/memory/io) between:

create temp table foo as select * from bar where bar.date > '2007-01-01';
copy foo to '/tmp/bar.out';
drop table temp;

and this:

copy ( select * from bar where bar.date > '2007-01-01' ) to '/tmp/bar.out';

...that would lead me to use one method vs. the other on large data sets (1M+ records)?

Just wondering,
Jason

pgsql-general by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: FATAL: could not reattach to shared memory (Win32)
Next
From: Tom Lane
Date:
Subject: Re: Preferred usage for 'copy to' for a subset of data