[postgis-devel] JDBC & WKB - 400% overhead

strk at refractions.net strk at refractions.net
Wed Feb 23 09:32:16 PST 2005


That's the way bytea is sent over ascii cursor.
If you can't get a binary cursor for whatever reason
you can use canonical output to obtain your HEXWKB form.
Be aware that canonical output actually returns HEXEWKB,
which is WKB extended with SRID, Z and M. To enforce an
OGC conformant WKB you need to setSRID(force_2d(geom), -1).

--strk;


On Wed, Feb 23, 2005 at 12:25:01PM -0500, dblasby at openplans.org wrote:
> Markus,
> 
> >Maybe your postgresql driver only uses text transfer up to now.
> >asBinary() returns a byte array, so this should be transferred more
> >efficiently.
> 
> I'm using the JDBC3 build 310 drivers (latest from jdbc.postgresql.org).
> 
> >Can you try the following query:
> >
> >select 5::float8,asBinary('POINT(0 0)')::bytea
> >
> asBinary() already returns a bytea:
> 
> #\df asbinary
>                      List of functions
>  Schema |   Name   | Result data type | Argument data types
> --------+----------+------------------+---------------------
>  public | asbinary | bytea            | geometry
>  public | asbinary | bytea            | geometry, text
> (2 rows)
> 
> But, I tried your query and it, also, sends 84 bytes.
> 
> dave
> 
> 
> ----------------------------------------------------------
> This mail sent through IMP: https://webmail.limegroup.com/
> _______________________________________________
> postgis-devel mailing list
> postgis-devel at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-devel



More information about the postgis-devel mailing list