Re: Input and Output data traffic

From: Karsten Hilbert <Karsten(dot)Hilbert(at)gmx(dot)net>
To: psycopg(at)postgresql(dot)org
Subject: Re: Input and Output data traffic
Date: 2011-05-11 12:21:31
Message-ID: 20110511122131.GL6613@hermes.hilbert.loc
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse psycopg by date

  From Date Subject
Next Message Israel Ben Guilherme Fonseca 2011-05-11 12:36:04 Re: Input and Output data traffic
Previous Message Karsten Hilbert 2011-05-11 12:17:55 Re: Input and Output data traffic