batch inserts in python & libpq

From: Scara Maccai <m_lists(at)yahoo(dot)it>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: batch inserts in python & libpq
Date: 2009-08-07 13:37:08
Message-ID: 510173.98513.qm@web24611.mail.ird.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


Hi all,

using Java I'm able to get a 10000 inserts/sec on our server using batch updates (using preparedStatement.addBatch()).

Using Python I can't get past 2000 inserts/sec, which is roughly the same performance of Java without addBatch.

Is there a Python driver that uses the same protocol form of addBatch in Java?
I even looked at the libpq to see, but I couldn't find any reference to batch updating... not even in the protocol specs. Sniffing the protocol I think I got that mainly the difference is in the round-trips to the server... but don't know how to tell the Python driver/libpq to do it "the Java way".

Responses

Browse pgsql-general by date

  From Date Subject
Next Message John 2009-08-07 13:42:07 using the schema in postbooks
Previous Message Alban Hertroys 2009-08-07 11:35:07 Re: Make check fails on 8.3.7