Skip site navigation (1) Skip section navigation (2)

Re: Array interface

From: Mark Kirkwood <mark(dot)kirkwood(at)catalyst(dot)net(dot)nz>
To: pgsql-performance(at)postgresql(dot)org
Subject: Re: Array interface
Date: 2010-11-10 09:42:39
Message-ID: 4CDA690F.1030408@catalyst.net.nz (view raw or flat)
Thread:
Lists: pgsql-performance
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


Attachment: execinsert-values.pl
Description: application/x-perl (1.2 KB)

In response to

pgsql-performance by date

Next:From: Kevin GrittnerDate: 2010-11-10 12:38:43
Subject: Re: anti-join chosen even when slower than old plan
Previous:From: 静安寺Date: 2010-11-10 09:37:29
Subject: Why dose the planner select one bad scan plan.

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group