pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dave Cramer <pg@fastcrypt.com>
To: List <pgsql-jdbc@postgresql.org>
Subject: binary protocol was Performance problem with timestamps in result sets
Date: Thu, 9 Mar 2006 07:11:17 -0500
Message-ID: <20CDAF3A-82E6-4E56-84A7-DC2EC202D703@fastcrypt.com> (raw)
In-Reply-To: <440FED54.4030900@opencloud.com>
References: <224f32340603080537ld424d49l2eea9440594104d3@mail.gmail.com>
	<060a01c642bf$b3060220$9001a8c0@zaphod>
	<224f32340603080657m35f7c35do34a2c6dc3f1b5f0@mail.gmail.com>
	<006201c642c2$1f17a610$c29c143e@w128mtec>
	<440FED54.4030900@opencloud.com>

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



view thread (6+ messages)  latest in thread

Message-ID: <20CDAF3A-82E6-4E56-84A7-DC2EC202D703@fastcrypt.com>
Permalink:  ../20CDAF3A-82E6-4E56-84A7-DC2EC202D703@fastcrypt.com/
Also on:    postgresql.org/message-id/20CDAF3A-82E6-4E56-84A7-DC2EC202D703@fastcrypt.com

 · 

reply

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: pg@fastcrypt.com
  Subject: Re: binary protocol was Performance problem with timestamps in result sets
  In-Reply-To: <20CDAF3A-82E6-4E56-84A7-DC2EC202D703@fastcrypt.com>
  References: <224f32340603080537ld424d49l2eea9440594104d3@mail.gmail.com> <060a01c642bf$b3060220$9001a8c0@zaphod> <224f32340603080657m35f7c35do34a2c6dc3f1b5f0@mail.gmail.com> <006201c642c2$1f17a610$c29c143e@w128mtec> <440FED54.4030900@opencloud.com> <20CDAF3A-82E6-4E56-84A7-DC2EC202D703@fastcrypt.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