Re: COPY versus INSERT - Mailing list pgsql-general

From alex b.
Subject Re: COPY versus INSERT
Date
Msg-id 3EC26FED.1040803@gmx.de
Whole thread Raw
In response to Re: COPY versus INSERT  ("alex b." <mailinglists1@gmx.de>)
List pgsql-general
alex b. wrote:
>
>> Almost always.
>>
>> Might want to try batching your INSERTs into transactions of a few
>> hundred-few thousand first though - that frequently helps a lot:
>>
>> BEGIN;
>> INSERT ...1
>> INSERT ...2
>> ...
>> INSERT ...999
>> COMMIT;
>>
>
> I have a perl script, that runs a loop, in which it executes a prepared
> INSERT INTO query...
>
> the loop takes about 1 - 2 seconds...
>
> does BEGIN; .... COMMIT;  also apply to some PREPARE-routines?

well, I just tried it, YES IT DOES ALSO APPLY ....




pgsql-general by date:

Previous
From: Doug McNaught
Date:
Subject: Re: COPY versus INSERT
Next
From: Tom Lane
Date:
Subject: Re: - what protocol for an Internet postgres connection