Binary binding patch v1

From: Mikko Tiihonen <mikko(dot)tiihonen(at)iki(dot)fi>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Binary binding patch v1
Date: 2006-12-17 19:47:37
Message-ID: 1166384857.6923.30.camel@dual.local
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Hi,

It seems I found nothing better to do... So here is the first patch that
allows using of binary transfers for bind data. The patch must be
applied on top of the binaryResultSet-v6.patch.

The old code supported binary transfers only for BYTEA type. Now also
INT2, INT4, INT8, FLOAT4 and FLOAT8 are supported. The patch is actually
quite simple, but testing for performance improvements is harder than
for selects because the backend settings have larger effect on the
result.
My current results show around 5-10% speedup and 20-30% memory use
reduction, measured from the test code.

I started working on DATE/TIME/TIMEZONE binary sending too, but I'm
afraid it might not be possible. At least based on the long comments
describing problems with the current text format sending which requires
the use of UNSPECIFIED oid. I did actually get DATE to work by sending
it as Oid.DATE. But since the java.sql.Date actually contains also the
time part I'm not sure if it should be sent using Oid.TIMESTAMP.
Actually I think if binary sending of time/date is ever done it most
likely should always use TIMESTAMPTZ format and then let the backend
do the conversion to correct type. But as the comments in the jdbc
driver show the backend seems a bit buggy in this regard.

-Mikko

Attachment Content-Type Size
binarySend-v1.patch text/x-patch 17.2 KB

Browse pgsql-jdbc by date

  From Date Subject
Next Message Peter Neu 2006-12-18 09:53:39 Efficient Insert statement for one record into multiple tables?
Previous Message Mikko Tiihonen 2006-12-16 11:24:06 Binary resultset patch v6