Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 85ED41337B80 for ; Thu, 12 May 2011 02:35:14 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 25100-06 for ; Thu, 12 May 2011 05:35:07 +0000 (UTC) X-Greylist: delayed 00:16:30.045137 by SQLgrey-1.7.6 Received: from mail-pz0-f46.google.com (mail-pz0-f46.google.com [209.85.210.46]) by mail.postgresql.org (Postfix) with ESMTP id 379531337999 for ; Thu, 12 May 2011 02:35:06 -0300 (ADT) Received: by pzk9 with SMTP id 9so563100pzk.19 for ; Wed, 11 May 2011 22:35:05 -0700 (PDT) MIME-Version: 1.0 Received: by 10.143.19.5 with SMTP id w5mr5804675wfi.40.1305177062626; Wed, 11 May 2011 22:11:02 -0700 (PDT) Received: by 10.142.191.14 with HTTP; Wed, 11 May 2011 22:11:02 -0700 (PDT) In-Reply-To: References: Date: Wed, 11 May 2011 22:11:02 -0700 Message-ID: Subject: Re: Incoming/Sent traffic data From: Maciek Sakrejda To: Israel Ben Guilherme Fonseca Cc: pgsql-jdbc@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201105/21 X-Sequence-Number: 21851 > The postgre log: > > Python LOG: comando: select * from pessoa > Java LOG: executar : 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