Re: Input and Output data traffic - Mailing list psycopg

From Karsten Hilbert
Subject Re: Input and Output data traffic
Date
Msg-id 20110511122131.GL6613@hermes.hilbert.loc
Whole thread Raw
In response to Re: Input and Output data traffic  (Israel Ben Guilherme Fonseca <israel.bgf@gmail.com>)
Responses Re: Input and Output data traffic  (Israel Ben Guilherme Fonseca <israel.bgf@gmail.com>)
List psycopg
On Wed, May 11, 2011 at 09:01:35AM -0300, Israel Ben Guilherme Fonseca wrote:

> I'm not with java code right now, but the python one is this:
>
>     def inserir(self, curso):
>         cursor = self.conn.cursor()
>         cursor.execute("""insert into Curso(area, carga_horaria, ementa,
> nome)
>                           values(%s, %s, %s, %s)""",
>                           (curso.area, curso.carga_horaria, curso.ementa,
> curso.nome))
>         cursor.close()
>         self.conn.commit()
>
> - Simple insert, without returning.
> - With a proxy between application and database i measured the quantity of
> transfered data.
> - Executed 1000 times.

Is the connection torn down and set up for each of those
runs ? That would account for some back-traffic due to
connection setup queries being run by psycopg2.

1) What's your objective ? Are you trying to solve a
real-world problem ? Or is this premature optimization ?

2) If the claim that JDBC needs a lot less back traffic for
getting the same amount of work done we'd surely like to
know why and how (for which we'd need details) in order to
decide whether there's something to be gained from that
insight.

Karsten
--
GPG key ID E4071346 @ gpg-keyserver.de
E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346

psycopg by date:

Previous
From: Karsten Hilbert
Date:
Subject: Re: Input and Output data traffic
Next
From: Israel Ben Guilherme Fonseca
Date:
Subject: Re: Input and Output data traffic