X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id A02D58B9E8D for ; Wed, 23 Feb 2005 14:57:49 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 23804-08 for ; Wed, 23 Feb 2005 14:57:37 +0000 (GMT) Received: from mail.logi-track.com (burro.logi-track.com [213.239.193.212]) by svr1.postgresql.org (Postfix) with ESMTP id 812398B9E93 for ; Wed, 23 Feb 2005 14:57:39 +0000 (GMT) Received: from kingfisher.intern.logi-track.com (J064b.j.pppool.de [85.74.6.75]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.logi-track.com (Postfix) with ESMTP id 7F1F9307F7; Wed, 23 Feb 2005 15:57:43 +0100 (CET) Received: from [127.0.0.1] (localhost [127.0.0.1]) by kingfisher.intern.logi-track.com (Postfix) with ESMTP id 6D049AB286; Wed, 23 Feb 2005 15:57:38 +0100 (CET) Message-ID: <421C99E1.4070107@logi-track.com> Date: Wed, 23 Feb 2005 15:57:37 +0100 From: Markus Schaber User-Agent: Mozilla Thunderbird 1.0 (X11/20050116) X-Accept-Language: de-DE, de, en-us, en MIME-Version: 1.0 To: PostGIS Development Discussion , "pgsql-jdbc@postgresql.org" , David Blasby Subject: Re: [postgis-devel] JDBC & WKB - 400% overhead References: <1109097544.421b7c482a529@webmail.limegroup.com> In-Reply-To: <1109097544.421b7c482a529@webmail.limegroup.com> X-Enigmail-Version: 0.90.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: multipart/signed; micalg=pgp-ripemd160; protocol="application/pgp-signature"; boundary="------------enig07A80113C756DDF3B094868C" X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.053 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200502/171 X-Sequence-Number: 12351 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig07A80113C756DDF3B094868C Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable [X-Post to better place for discussion] Hi, David, dblasby@openplans.org schrieb: > 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. >=20 > .. > ResultSet rs2 =3D st.executeQuery("select 5::float8,asBinary('POINT(0 0= )')"); > rs2.next(); > byte[] bs =3D rs2.getBytes(2); > assertTrue(bs.length =3D=3D 21); >=20 > 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 =3D 21 bytes). >=20 > 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. >=20 > It clearly receives 84 bytes of data from the server. This is the byte= a > text representation: > \001\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\00= 0\000\000\000 >=20 > The ResultSet#getBytes() function converts this to a byte[]. Maybe your postgresql driver only uses text transfer up to now. asBinary() returns a byte array, so this should be transferred more efficiently. Can you try the following query: select 5::float8,asBinary('POINT(0 0)')::bytea Maybe the current 8.0-310 build has fixed this. But the pgsql-jdbc list could be the better place to ask this question, IMHO, so I forward it to there. Markus --=20 markus schaber | dipl. informatiker logi-track ag | rennweg 14-16 | ch 8001 z=FCrich phone +41-43-888 62 52 | fax +41-43-888 62 53 mailto:schabios@logi-track.com | www.logi-track.com --------------enig07A80113C756DDF3B094868C Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFCHJnhOVWsnapT9i0RAwlMAKDTtEBoXO6RlvUmcfPb/RpVM6rIewCeN7JD /dA2FSTOwA6H+cXI4VvdIfY= =BiAp -----END PGP SIGNATURE----- --------------enig07A80113C756DDF3B094868C--