Re: COPY FROM STDIN instead of INSERT

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Ilja Golshtein <ilejn(at)yandex(dot)ru>
Cc: pgsql-general(at)postgresql(dot)org, pgsql(at)007Marketing(dot)comp(dot)yandex(dot)ru
Subject: Re: COPY FROM STDIN instead of INSERT
Date: 2006-10-18 12:32:29
Message-ID: 20061018123229.GB11184@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)svana(dot)org> http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ilja Golshtein 2006-10-18 12:46:11 Re: COPY FROM STDIN instead of INSERT
Previous Message Ilja Golshtein 2006-10-18 12:20:41 Re: COPY FROM STDIN instead of INSERT