https://wiki.postgresql.org/api.php?action=feedcontributions&user=Njw45&feedformat=atomPostgreSQL wiki - User contributions [en]2024-03-28T16:59:46ZUser contributionsMediaWiki 1.35.13https://wiki.postgresql.org/index.php?title=JDBC-BinaryTransfer&diff=19275JDBC-BinaryTransfer2013-03-24T03:24:34Z<p>Njw45: /* Configuration */</p>
<hr />
<div>=== JDBC Binary Transfer ===<br />
<br />
The idea of the binary transfer patch to the [[JDBC]] driver is to transfer all binary types from the PostgreSQL server to the JDBC driver in their binary form.<br />
<br />
This eliminates the need to convert f.ex. number from their text representation to their binary representation.<br />
<br />
This patch will therefore provide a speedup of the JDBC performance.<br />
<br />
== Configuration ==<br />
<br />
The binary transfer is enabled by default, but is controlled by the<br />
<br />
binaryTransfer=boolean<br />
<br />
flag on the connection url.<br />
<br />
An example:<br />
<br />
jdbc:postgresql://localhost:5432:mydatabase?binaryTransfer=true<br />
<br />
Furthermore you are able to force binary transfer using the<br />
<br />
-Dorg.postgresql.forcebinary=boolean<br />
<br />
JVM argument.<br />
<br />
An example:<br />
<br />
java -Dorg.postgresql.forcebinary=true -classpath myjar.jar MyApp<br />
<br />
If the ''compatible'' version is less that 8.0 then values of type ''TIME'', ''TIMETZ'', ''TIMESTAMP'' and ''TIMESTAMPTZ'' are '''never''' transferred in binary format.<br />
<br />
If the ''compatible'' version is less that 8.3 then values of type ''INT2_ARRAY'', ''INT4_ARRAY'', ''INT8_ARRAY'', ''FLOAT4_ARRAY'', ''FLOAT8_ARRAY'', ''VARCHAR_ARRAY'' and ''TEXT_ARRAY'' are '''never''' transferred in binary format.<br />
<br />
== Development ==<br />
<br />
The patch was developed by Mikko, with modifications by Kris and minor updates by Jesper.<br />
<br />
== Testing ==<br />
* Jignesh: [http://blogs.sun.com/jkshah/entry/postgres_8_4_testing_with Postgres 8.4 Testing with new JDBC Drivers]<br />
<br />
== Versions ==<br />
=== v13 ===<br />
* Sync with CVS HEAD (2009/06/23)<br />
<br />
=== v12 ===<br />
* Sync with CVS HEAD (2009/06/02)<br />
<br />
=== v11 ===<br />
* Fixed Statement::executeQuery(String) in regards to ResultSet <br />
* Added binary transfer to the test suite<br />
* Added simple Statement ResultSet test<br />
<br />
=== v10 ===<br />
* Sync with CVS HEAD<br />
* build.xml - cleanups regarding def_pgport<br />
* build.properties - cleanups regarding def_pgport<br />
* QueryExecutor - corrected the constant value<br />
* QueryExecutorImpl - removed unneeded code paths<br />
<br />
=== v9 and older ===<br />
* [http://mokki.dyndns.org/~mtiihone/postgresql/binarytransfer/ Mikko's site]<br />
<br />
== Patches ==<br />
* [http://wiki.postgresql.org/wiki/Image:BinaryTransfer-v13.patch.gz BinaryTransfer-v13 (part1)]<br />
* [http://wiki.postgresql.org/wiki/Image:ByteConverter.java.gz BinaryTransfer-v13 (part2)]<br />
* [http://wiki.postgresql.org/wiki/Image:BinaryTransfer-v12.patch.gz BinaryTransfer-v12 (part1)]<br />
* [http://wiki.postgresql.org/wiki/Image:ByteConverter.java.gz BinaryTransfer-v12 (part2)]<br />
* [http://wiki.postgresql.org/wiki/Image:BinaryTransfer-v11.patch.gz BinaryTransfer-v11 (part1)]<br />
* [http://wiki.postgresql.org/wiki/Image:ByteConverter.java.gz BinaryTransfer-v11 (part2)]<br />
<br />
[[Category:Performance]]</div>Njw45https://wiki.postgresql.org/index.php?title=JDBC-BinaryTransfer&diff=19274JDBC-BinaryTransfer2013-03-24T03:23:18Z<p>Njw45: </p>
<hr />
<div>=== JDBC Binary Transfer ===<br />
<br />
The idea of the binary transfer patch to the [[JDBC]] driver is to transfer all binary types from the PostgreSQL server to the JDBC driver in their binary form.<br />
<br />
This eliminates the need to convert f.ex. number from their text representation to their binary representation.<br />
<br />
This patch will therefore provide a speedup of the JDBC performance.<br />
<br />
== Configuration ==<br />
<br />
The binary transfer is enabled by default, but is controlled by the<br />
<br />
binaryTransfer=boolean<br />
<br />
flag on the connection url.<br />
<br />
An example:<br />
<br />
jdbc:postgresql://localhost:5432:mydatabase?binaryTransfer=true<br />
<br />
Furthermore you are able to force binary transfer using the<br />
<br />
-Dorg.postgresql.forcebinary=boolean<br />
<br />
JVM argument.<br />
<br />
An example:<br />
<br />
java -Dorg.postgresql.forcebinary=true -classpath myjar.jar MyApp<br />
<br />
If the ''compatible'' version is less that 8.0 then values of type ''TIME'', ''TIMETZ'', ''TIMESTAMP'' and ''TIMESTAMPTZ'' are '''never''' transferred in binary format.<br />
<br />
== Development ==<br />
<br />
The patch was developed by Mikko, with modifications by Kris and minor updates by Jesper.<br />
<br />
== Testing ==<br />
* Jignesh: [http://blogs.sun.com/jkshah/entry/postgres_8_4_testing_with Postgres 8.4 Testing with new JDBC Drivers]<br />
<br />
== Versions ==<br />
=== v13 ===<br />
* Sync with CVS HEAD (2009/06/23)<br />
<br />
=== v12 ===<br />
* Sync with CVS HEAD (2009/06/02)<br />
<br />
=== v11 ===<br />
* Fixed Statement::executeQuery(String) in regards to ResultSet <br />
* Added binary transfer to the test suite<br />
* Added simple Statement ResultSet test<br />
<br />
=== v10 ===<br />
* Sync with CVS HEAD<br />
* build.xml - cleanups regarding def_pgport<br />
* build.properties - cleanups regarding def_pgport<br />
* QueryExecutor - corrected the constant value<br />
* QueryExecutorImpl - removed unneeded code paths<br />
<br />
=== v9 and older ===<br />
* [http://mokki.dyndns.org/~mtiihone/postgresql/binarytransfer/ Mikko's site]<br />
<br />
== Patches ==<br />
* [http://wiki.postgresql.org/wiki/Image:BinaryTransfer-v13.patch.gz BinaryTransfer-v13 (part1)]<br />
* [http://wiki.postgresql.org/wiki/Image:ByteConverter.java.gz BinaryTransfer-v13 (part2)]<br />
* [http://wiki.postgresql.org/wiki/Image:BinaryTransfer-v12.patch.gz BinaryTransfer-v12 (part1)]<br />
* [http://wiki.postgresql.org/wiki/Image:ByteConverter.java.gz BinaryTransfer-v12 (part2)]<br />
* [http://wiki.postgresql.org/wiki/Image:BinaryTransfer-v11.patch.gz BinaryTransfer-v11 (part1)]<br />
* [http://wiki.postgresql.org/wiki/Image:ByteConverter.java.gz BinaryTransfer-v11 (part2)]<br />
<br />
[[Category:Performance]]</div>Njw45