From: mikael-aronsson <mikael-aronsson@telia.com>
To: pgsql-jdbc@postgresql.org
Subject: Re: binary protocol was Performance problem with timestamps in result sets
Date: Thu, 9 Mar 2006 13:39:09 +0100
Message-ID: <00cc01c64376$7661ca40$c29c143e@w128mtec> (raw)
How about the actual transport cost difference between text and binary
protocols ? it may not be any big difference though, and many times text
representation can be smaller then a binary protocol.
I have no idea about endianness, but as the clients works fine between
different platforms I would assume that the endian format in the protocol is
fixed (but you should not assume things so maybe I am hanging myself again
here).
I do not think it would give much though to use the binary protocol as Java
is not very good when it comes to converting binary data back to native
values unless it is serialized or you start to mess around with nio buffers,
so in the end I do not think there would be much difference in performance.
Mikael
----- Original Message -----
From: "mikael-aronsson" <mikael-aronsson@telia.com>
To: "Dave Cramer" <pg@fastcrypt.com>
Sent: Thursday, March 09, 2006 1:38 PM
Subject: Re: [JDBC] binary protocol was Performance problem with timestamps
in result sets
> How about the actual transport cost difference between text and binary
> protocols ? it may not be any big difference though, and many times text
> representation can be smaller then a binary protocol.
>
> I have no idea about endianness, but as the clients works fine between
> different platforms I would assume that the endian format in the protocol
> is fixed (but you should not assume things so maybe I am hanging myself
> again here).
>
> I do not think it would give much though to use the binary protocol as
> Java is not very good when it comes to converting binary data back to
> native values unless it is serialized or you start to mess around with nio
> buffers, so in the end I do not think there would be much difference in
> performance.
>
> Mikael
>
> ----- Original Message -----
> From: "Dave Cramer" <pg@fastcrypt.com>
> To: "List" <pgsql-jdbc@postgresql.org>
> Sent: Thursday, March 09, 2006 1:11 PM
> Subject: [JDBC] binary protocol was Performance problem with timestamps in
> result sets
>
>
>> As Oliver points out the timestamp is not a 64bit integer, or even a
>> floatingpoint number. It is a textual representation of the timestamp
>> which needs to be parsed. I looked at the parsing and I was unable to
>> see anything that could be significantly optimized.
>>
>> So the option of going to the binary protocol exists. There are a number
>> of challenges with this. As Oliver points out this is an all or nothing
>> proposition. In other words you can't ask for just timestamps to be
>> returned in binary. The entire row comes back as binary. Additionally,
>> there are two possible representations of timestamps in postgresql. One
>> is a 64 bit integer, the other is floating point. Added to this there
>> may be endian issues ( do we know the answer to this question ?)
>>
>> Significant performance improvement exists for dates, times, timestamps,
>> however the advantages for the rest of the types is questionable given
>> the above assertions.
>>
>> Comments ?
>>
>> Dave
>>
>> ---------------------------(end of broadcast)---------------------------
>> TIP 1: if posting/reading through Usenet, please send an appropriate
>> subscribe-nomail command to majordomo@postgresql.org so that your
>> message can get through to the mailing list cleanly
>
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: mikael-aronsson@telia.com
Subject: Re: binary protocol was Performance problem with timestamps in result sets
In-Reply-To: <00cc01c64376$7661ca40$c29c143e@w128mtec>
References: <00cc01c64376$7661ca40$c29c143e@w128mtec>
* 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