Re: [postgis-devel] JDBC & WKB - 400% overhead
От | Kris Jurka |
---|---|
Тема | Re: [postgis-devel] JDBC & WKB - 400% overhead |
Дата | |
Msg-id | Pine.BSO.4.56.0502231405360.11888@leary.csoft.net обсуждение исходный текст |
Ответ на | Re: [postgis-devel] JDBC & WKB - 400% overhead (Markus Schaber <schabios@logi-track.com>) |
Ответы |
Re: [postgis-devel] JDBC & WKB - 400% overhead
|
Список | pgsql-jdbc |
On Wed, 23 Feb 2005, Markus Schaber wrote: > > 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). > > > > 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[]. > > Maybe your postgresql driver only uses text transfer up to now. > asBinary() returns a byte array, so this should be transferred more > efficiently. > The driver receives all data as text. To be able to receive binary data we must support binary data for all types because we do not know what type we will be getting back from the SELECT before it is run. Getting that information would require an extra network round trip so we don't want to do that. Doing all binary transfer is on the 8.1 todo list, but I've yet to really get started on it. Kris Jurka
В списке pgsql-jdbc по дате отправления: