Re: COPY vs INSERT - Mailing list pgsql-performance

From David Roussel
Subject Re: COPY vs INSERT
Date
Msg-id 1115246490.1709.233393619@webmail.messagingengine.com
Whole thread Raw
In response to Re: COPY vs INSERT  (Mischa Sandberg <mischa.sandberg@telus.net>)
Responses Re: COPY vs INSERT  (Mischa Sandberg <mischa.sandberg@telus.net>)
Re: COPY vs INSERT  (John A Meinel <john@arbash-meinel.com>)
Re: COPY vs INSERT  (Christopher Kings-Lynne <chriskl@familyhealth.com.au>)
List pgsql-performance
> COPY invokes all the same logic as INSERT on the server side
> (rowexclusive locking, transaction log, updating indexes, rules).
> The difference is that all the rows are inserted as a single
> transaction. This reduces the number of fsync's on the xlog,
> which may be a limiting factor for you. You'll want to crank
> WAL_BUFFERS and CHECKPOINT_SEGMENTS to match, though.
> One of my streams has 6K records; I run with WB=1000, CS=128.

So what's the difference between a COPY and a batch of INSERT
statements.  Also, surely, fsyncs only occur at the end of a
transaction, no need to fsync before a commit has been issued, right?

David

pgsql-performance by date:

Previous
From: "Mike G."
Date:
Subject: Table stats
Next
From: Mischa Sandberg
Date:
Subject: Re: COPY vs INSERT