X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 3DB8D9DCAA3 for ; Thu, 9 Mar 2006 08:11:18 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 49233-09 for ; Thu, 9 Mar 2006 08:11:20 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from net2.micro-automation.com (net2.micro-automation.com [64.7.141.29]) by postgresql.org (Postfix) with SMTP id DC3699DCA28 for ; Thu, 9 Mar 2006 08:11:15 -0400 (AST) Received: (qmail 1029 invoked from network); 9 Mar 2006 12:11:19 -0000 Received: from dcdsl.ebox.com (HELO ?192.168.1.2?) (davec@64.7.143.116) by net2.micro-automation.com with SMTP; 9 Mar 2006 12:11:19 -0000 Mime-Version: 1.0 (Apple Message framework v746.2) 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> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <20CDAF3A-82E6-4E56-84A7-DC2EC202D703@fastcrypt.com> Content-Transfer-Encoding: 7bit From: Dave Cramer Subject: binary protocol was Performance problem with timestamps in result sets Date: Thu, 9 Mar 2006 07:11:17 -0500 To: List X-Mailer: Apple Mail (2.746.2) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.121 required=5 tests=[AWL=0.121] X-Spam-Score: 0.121 X-Spam-Level: X-Archive-Number: 200603/46 X-Sequence-Number: 14827 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