Re: COPY FROM STDIN instead of INSERT - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: COPY FROM STDIN instead of INSERT
Date
Msg-id 20061018123229.GB11184@svana.org
Whole thread Raw
In response to Re: COPY FROM STDIN instead of INSERT  ("Ilja Golshtein" <ilejn@yandex.ru>)
Responses Re: COPY FROM STDIN instead of INSERT  ("Ilja Golshtein" <ilejn@yandex.ru>)
Re: COPY FROM STDIN instead of INSERT  ("Merlin Moncure" <mmoncure@gmail.com>)
List pgsql-general
On Wed, Oct 18, 2006 at 04:20:41PM +0400, Ilja Golshtein wrote:
> And my question remains.
> Is it Ok to use COPY BINARY FROM STDIN instead of multiple INSERTs?

The reason why copy is faster is because it doesn't have to
parse/plan/execute all the queries. In exchange you can't use
expressions or joins to fill the table, only raw data.

Binary may be slightly faster because the datum parsing can be
partially skipped, but that's hardly much benefit over a text copy.

Hope this helps,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Attachment

pgsql-general by date:

Previous
From: "Ilja Golshtein"
Date:
Subject: Re: COPY FROM STDIN instead of INSERT
Next
From: "Ilja Golshtein"
Date:
Subject: Re: COPY FROM STDIN instead of INSERT