Search Postgresql Archives

Re: batch inserts in python & libpq

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Aug 07, 2009 at 01:37:08PM +0000, Scara Maccai wrote:
> using Java I'm able to get a 10000 inserts/sec on our server using
> batch updates (using preparedStatement.addBatch()).

I'd probably generate SQL that looks somewhat like the following:

  UPDATE foo f SET v = x.v
    FROM (VALUES (1,'hi'), (2,'bye')) x(i,v)
    WHERE f.id = x.i;

The "best" solution depends on the details of the problem though!

-- 
  Sam  http://samason.me.uk/

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux