Re: COPY vs INSERT

From: "David Roussel" <pgsql-performance(at)diroussel(dot)xsmail(dot)com>
To: "Mischa Sandberg" <mischa(dot)sandberg(at)telus(dot)net>, "pgsql-perform" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: COPY vs INSERT
Date: 2005-05-04 22:41:30
Message-ID: 1115246490.1709.233393619@webmail.messagingengine.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Mischa Sandberg 2005-05-04 23:11:32 Re: COPY vs INSERT
Previous Message Mike G. 2005-05-04 14:58:25 Table stats