Improve transfer buffer utilization for Clobs
---------------------------------------------

                 Key: DERBY-3918
                 URL: https://issues.apache.org/jira/browse/DERBY-3918
             Project: Derby
          Issue Type: Improvement
          Components: JDBC, Network Server
    Affects Versions: 10.5.0.0
            Reporter: Kristian Waagan
            Priority: Minor


Read DERBY-3769 for details.

Briefly, for Clobs containing ASCII characters the content is sent over the 
network in smaller chunks than necessary. The reason is because the network 
server is unaware of how many bytes a range of characters results in when they 
are encoded as modified UTF-8. As exceeding the maximum size is very costly, a 
defensive assumption of 3 bytes per char is used. This leads to sending only 
10890 bytes over the wire per round-trip instead of up to 32672 for ASCII 
content.

The same goes for Clobs with chars encoded by 2 bytes, or Clobs with mixed 
content.

A few ideas on how to solve this:
 - read chars in chunks, look at each char to calculate byte length and read 
chars until byte buffer will be filled sufficiently
 - add new method to Engine[C]LOB
 - rewrite implementation to work on the byte level instead of the character 
level (this would be an internal API only)
 - add and make use of more information about the Clob content, i.e. if it 
consists of only 1 byte per char encodings.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to