pg.ddx.io  postgis-devel@lists.osgeo.org mailing list archive (PostGIS development)  
help / color / mirror / Atom feed
From: dblasby at openplans.org <dblasby@openplans.org>
Subject: [postgis-devel] JDBC & WKB - 400% overhead
Date: Wed, 23 Feb 2005 14:18:24 -0500
Message-ID: <1109186304.421cd700de01b@webmail.limegroup.com> (raw)

>Sad. But at least, we can be shure that it is a bytea specific problem
>and not a PostGIS specific problem.
>

Well - if you look at the ResultSet#getBytes() code, it explicity
decodes the "\000" format for columns of type bytea.

Perhaps using a Base64 encoding would be a good idea - its almost 3* as
efficient as this encoding (ie. 4 transfer bytes gives you 3 bytes of
actual data).

So, this is, fundamentally, a bytea problem.  Its really a SQL spec
problem since this is the defined behaviour for bytea transit - its
unlikely the case that Postgresql folks will change it.

But, its a postgis problem because its using bytea as the
representation.

Has anyone looked at just returning straight binary?  Postgresql
[usually] does not use cstrings (null terminated) - it uses pascal-like
strings (first 4 bytes are length, followed by byte data).  If you look
at the transit code, if you just write out straight binary, it should
be able to handle it.  Of course, you will no longer be able to use it
interactively because programs like psql will expect the output to be
cstrings.

dave




----------------------------------------------------------
This mail sent through IMP: https://webmail.limegroup.com/




view thread (10+ messages)  latest in thread

Message-ID: <1109186304.421cd700de01b@webmail.limegroup.com>
Permalink:  ../1109186304.421cd700de01b@webmail.limegroup.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: postgis-devel@lists.osgeo.org
  Cc: dblasby@openplans.org
  Subject: Re: [postgis-devel] JDBC & WKB - 400% overhead
  In-Reply-To: <1109186304.421cd700de01b@webmail.limegroup.com>
  References: <1109186304.421cd700de01b@webmail.limegroup.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