pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Christoph Haller <ch@rodos.fzk.de>
To: pgsql-sql@postgresql.org
Cc: gary.stainburn@ringways.co.uk
Subject: Re: Insert multiple Rows
Date: Wed, 05 Mar 2003 09:38:06 +0100
Message-ID: <3E65B76E.D6E118D7@rodos.fzk.de> (raw)

>
> 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





view thread (7+ messages)  latest in thread

Message-ID: <3E65B76E.D6E118D7@rodos.fzk.de>
Permalink:  ../3E65B76E.D6E118D7@rodos.fzk.de/
Also on:    postgresql.org/message-id/3E65B76E.D6E118D7@rodos.fzk.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: ch@rodos.fzk.de, gary.stainburn@ringways.co.uk
  Subject: Re: Insert multiple Rows
  In-Reply-To: <3E65B76E.D6E118D7@rodos.fzk.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox