pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mark Kirkwood <mark.kirkwood@catalyst.net.nz>
To: pgsql-performance@postgresql.org
Subject: Re: Array interface
Date: Wed, 10 Nov 2010 22:42:39 +1300
Message-ID: <4CDA690F.1030408@catalyst.net.nz> (raw)
In-Reply-To: <4CDA618F.7050102@catalyst.net.nz>
References: <4CD06A81.1020800@vmsinfo.com>
	<4CDA618F.7050102@catalyst.net.nz>

On 10/11/10 22:10, Mark Kirkwood wrote:
>
> What might also be interesting is doing each INSERT with an array-load 
> of bind variables appended to the VALUES clause - as this will only do 
> 1 insert call per "array" of values.

This is probably more like what you were expecting:

rows    num values tuples(i.e array size) elapsed
1000000                 1                     106
1000000                10                      14
1000000               100                      13
1000000              1000                      14

I didn't try to use PREPARE + EXECUTE here, just did "do" with the 
INSERT + array size number of VALUES tuples (execute could well be 
faster). The obvious difference here is we only do rows/(array size) 
number of insert calls.

Cheers

Mark

Attachments:

  execinsert-values.pl (application/x-perl, 1.2K) download

view thread (7+ messages)

Message-ID: <4CDA690F.1030408@catalyst.net.nz>
Permalink:  ../4CDA690F.1030408@catalyst.net.nz/
Also on:    postgresql.org/message-id/4CDA690F.1030408@catalyst.net.nz

 · 

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-performance@postgresql.org
  Cc: mark.kirkwood@catalyst.net.nz
  Subject: Re: Array interface
  In-Reply-To: <4CDA690F.1030408@catalyst.net.nz>

* 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