Man now YOU really screwed my mind. AHUAHua
Actually i'm doing tests for all operations (insert, select, delete, update), but here in mailist to keep things simple I'm trying to focus on the insert operation.
Let's keep simple. The objective is (example):
Java
sent: 100 bytes
received 30 bytes
Python
sent: 100 bytes
received: 85 bytes
I want to see the python driver getting the same result (forget about % differences maybe that turned everything more confuse). Did you get it?
But anyway, I'll do more tests, and maybe even put some charts here, I'll recheck my implementations too. We are talking about this since the morning and I didn't have time to recheck the code (now with postgres logs like sugested). Maybe everything is an false alarm. :)
2011/5/11 Karsten Hilbert
<Karsten.Hilbert@gmx.net>On Wed, May 11, 2011 at 02:37:28PM -0300, Israel Ben Guilherme Fonseca wrote:
> With that extra clause on every commit, that could increase the size of the
> sent data. JDBC doesn't do it, so maybe it could be the cause, at last for
> the sent data not the received data.
This is what you originally wrote:
>> The volume of sent data (application -> database) and the response data
>> (database -> application) are basically the same.
>>
>> For simple inserts/updates/deletes i got a difference of about 15% between
>> sent and received data.
(later you said you were testing INSERTs only ...)
>> I used a ruby driver and got the same results for the same instruction.
>>
>> Finally I used a Java JDBC driver (for postgres too), and the difference was
>> huge, it was 70% (the received data was much smaller).
What you've been wondering here is this:
- psycopg2 sends, say, 100 bytes (+some) and receives 85 bytes (+some)
- JDBC sends, say, 100 bytes and receives 30 bytes
Now, since psycopg2 supposedly *sends more* data (namely
setting the transaction isolation level) how is that
supposed to make the difference between sent and received
*smaller* ? This would only make sense if the "more" data
would provoke *a lot more* data to be received. Which
setting the transaction isolation certainly shouldn't.
But maybe I'm royally screwing up my thinking :-)))