Re: Insert multiple Rows - Mailing list pgsql-sql

From Christoph Haller
Subject Re: Insert multiple Rows
Date
Msg-id 3E65B76E.D6E118D7@rodos.fzk.de
Whole thread Raw
In response to Insert multiple Rows  (saintxplo@yahoo.com.ar (Saint X))
List pgsql-sql
>
> If you use a 'prepared' insert within a transaction, would that speed
things
> up - maybe by defering index updates?
>
I doubt it.


From: Neil Conway <neilc@samurai.com>
... I'd suspect that for most INSERT queries, the
parsing/rewriting/planning stages are relatively inexpensive, and the
bulk of the runtime is spent in the executor (and writing WAL records,
etc). So my guess would be that you won't see that much of a performance

improvement from this...

I've noticed a real performance boost using COPY

something like ...

PQexec("COPY xxx FROM stdin");
for (...)
{   sprintf(buf, "%d\t%d\t...\n",           values[0], values[1], ... values[n]);   PQputline(conn, buf);
}
PQputline(conn, "\\.\n");
PQendcopy(conn);

runs like hell.

Regards, Christoph




pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: Forcing query to use an index
Next
From: Rod Taylor
Date:
Subject: Re: Sorting by NULL values