Re: Insert multiple Rows

From: Christoph Haller <ch(at)rodos(dot)fzk(dot)de>
To: pgsql-sql(at)postgresql(dot)org
Cc: gary(dot)stainburn(at)ringways(dot)co(dot)uk
Subject: Re: Insert multiple Rows
Date: 2003-03-05 08:38:06
Message-ID: 3E65B76E.D6E118D7@rodos.fzk.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)samurai(dot)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

Browse pgsql-sql by date

  From Date Subject
Next Message luca.scaramella 2003-03-05 10:27:54 DELETE FROM A BLACK LIST
Previous Message Tomasz Myrta 2003-03-05 07:47:24 Re: sort / limit / range problem