From: Maciek Sakrejda <msakrejda@truviso.com>
To: Israel Ben Guilherme Fonseca <israel.bgf@gmail.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Incoming/Sent traffic data
Date: Wed, 11 May 2011 22:11:02 -0700
Message-ID: <BANLkTimgZ5Q-DTS1WMASgaPxYO3UWMSWLQ@mail.gmail.com> (raw)
In-Reply-To: <BANLkTi=+KqU37L7VEL4KDDqYMpTr7c-=9w@mail.gmail.com>
References: <BANLkTi=+KqU37L7VEL4KDDqYMpTr7c-=9w@mail.gmail.com>
> The postgre log:
>
> Python LOG: comando: select * from pessoa
> Java LOG: executar <unnamed>: select * from pessoa
>
> (translation from portuguese to english)
> comando -> command
> executar -> execute
Based on these log messages, it looks like this particular invocation
in Python is using the simple query protocol [1], whereas the JDBC one
is using the extended protocol [2] (with an unnamed statement and
unnamed portal). As far as I can tell, the JDBC driver only uses the
simple protocol for COPY. The extended query protocol is a little
chattier, but I wouldn't expect a *huge* difference there.
In any case, for what you're doing, I would strongly recommend looking
at a tool like Wireshark or tcpdump to get more accurate results and
more insight into what happens on the wire. E.g., I'm rather surprised
that the Java bytes written is 5 times (!) lower than the Python
version. Make sure you know what you're actually measuring.
[1]: http://developer.postgresql.org/pgdocs/postgres/protocol-flow.html#AEN91249
[2]: http://developer.postgresql.org/pgdocs/postgres/protocol-flow.html#PROTOCOL-FLOW-EXT-QUERY
---
Maciek Sakrejda | System Architect | Truviso
1065 E. Hillsdale Blvd., Suite 215
Foster City, CA 94404
(650) 242-3500 Main
www.truviso.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: msakrejda@truviso.com, israel.bgf@gmail.com
Subject: Re: Incoming/Sent traffic data
In-Reply-To: <BANLkTimgZ5Q-DTS1WMASgaPxYO3UWMSWLQ@mail.gmail.com>
References: <BANLkTi=+KqU37L7VEL4KDDqYMpTr7c-=9w@mail.gmail.com> <BANLkTimgZ5Q-DTS1WMASgaPxYO3UWMSWLQ@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox