Search Postgresql Archives

Re: Is it possible to make a streaming replication faster using COPY instead of lots of INSERTS?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 1 December 2011 04:00, David Johnston <polobo@xxxxxxxxx> wrote:
> On Nov 30, 2011, at 18:44, Craig Ringer <ringerc@xxxxxxxxxxxxx> wrote:
>
>> On 11/30/2011 10:32 PM, Sergey Konoplev wrote:
> Insert into tbl values(...); [times 50]
> insert into tbl values (...), (...), (...), ...; [ once with 50 values ]
> Copy [ with 50 input rows provided ]
>
> I would presume the first one is badly performing but no idea whether the multi-value version of insert would be outperformed by an equivalent Copy command (both on the main query and during replication)
>
> Though, does auto-commit affect the results in the first case; I.e., without auto-commit do the first two results replicate equivalently?

So the guaranteed solutions are either

BEGIN;
INSERT INTO table1 VALUES (...), (...), ...;
COMMIT;

or

COPY FROM ...;

correct?

>
>>
> David J



-- 
Sergey Konoplev

Blog: http://gray-hemp.blogspot.com
LinkedIn: http://ru.linkedin.com/in/grayhemp
JID/GTalk: gray.ru@xxxxxxxxx Skype: gray-hemp

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux