From: Paul Ramsey <pramsey@refractions.net>
Subject: [postgis-devel] JDBC & WKB - 400% overhead
Date: Tue, 22 Feb 2005 11:35:49 -0800
Message-ID: <421B8995.4020702@refractions.net> (raw)
In-Reply-To: <1109097544.421b7c482a529@webmail.limegroup.com>
References: <1109097544.421b7c482a529@webmail.limegroup.com>
This is with an ascii cursor, yes?
I wonder why they chose such a fluffy representation for the bytea
canonical form.
P.
dblasby at openplans.org wrote:
> I was checking to see if the WKB (postgis 1.0) was actually transiting
> "in binary" from the server (postgresql 8) to a JDBC (also postgresql
> 8) client.
>
> ..
> ResultSet rs2 = st.executeQuery("select 5::float8,asBinary('POINT(0
> 0)')");
> rs2.next();
> byte[] bs = rs2.getBytes(2);
> assertTrue(bs.length == 21);
>
> The WKB representation of a 'POINT(0 0)' is 21 bytes long (1 byte for
> xdr/ndr flag, 4 bytes for type, and 2 8-byte doubles = 21 bytes).
>
> If you step through the executeQuery() command in the postgresql driver,
> you'll eventually end up in PGStream#ReceiveTupleV3(). This is where
> the actual data is received from the database.
>
> It clearly receives 84 bytes of data from the server. This is the bytea
> text representation:
> \001\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000
>
> The ResultSet#getBytes() function converts this to a byte[].
>
> 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
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: pramsey@refractions.net
Subject: Re: [postgis-devel] JDBC & WKB - 400% overhead
In-Reply-To: <421B8995.4020702@refractions.net>
References: <1109097544.421b7c482a529@webmail.limegroup.com> <421B8995.4020702@refractions.net>
* 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