db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kristian Waagan <Kristian.Waa...@Sun.COM>
Subject Re: how to get data out from Clob?
Date Tue, 25 Nov 2008 15:26:31 GMT
Mikael Sundberg wrote:
> Thanks for the info 
> Does the same problem exist for Blob?
>   

There was a similar problem, but the fix for it should be in 10.4.2.0.
In many cases Blob is faster than Clob, because it doesn't have to deal 
with the character encoding issue. Derby is using the modified UTF-8 
encoding, where one character can be represented by either one, two or 
three bytes. This complicates the positioning logic, and you also get 
the cost of decoding/encoding of course.

If you can easily encode/decode your character data yourself and you 
only need to simply transfer the data between the client and the server, 
you might see some improvement by using Blob instead of Clob.
Of course, if the data volume is too large to fully represent it 
in-memory on the client, it complicates things for you to go with Blob.


-- 
Kristian

> Will update my testservers and try it. 
>
> -----Original Message-----
> From: Kristian.Waagan@Sun.COM [mailto:Kristian.Waagan@Sun.COM] 
> Sent: den 25 november 2008 14:01
> To: Derby Discussion
> Subject: Re: how to get data out from Clob?
>
> Mikael Sundberg wrote:
>   
>> Hi
>> Im using derby 10.4.2 and the clientdriver.
>> I changed from 
>>                 BufferedReader r = new BufferedReader(new
>> InputStreamReader(res.getAsciiStream("data")));
>>                 for (String line = r.readLine(); line != null; line =
>> r.readLine())
>>                 {
>>                     w.println(line);
>>                 }
>>
>> To
>> 	String data = res.getString("data");
>>
>> In a recent update to our application since the getString seemed to be
>> twice as fast then. Not entirely sure what versions of derby I tested
>>     
> on
>   
>> then.
>> So bacisly I should change back now?
>>     
>
> On the client driver, it doesn't matter (with respect to the bug I'm 
> talking about). I'm afraid you're stuck with the performance problem 
> until you upgrade to a newer version.
>
>   
>> We don't want to use any unstable
>> version on production so guess I will have to solve it some other way.
>>     
>
>   
>> Il atleast try out the latest version on my testservers to see if that
>> realy is the problem.
>>   
>>     
>
> I would consider using the newest bits from the 10.4 branch. The changes
>
> after the latest release are bug fixes, not new features.
> You can download test binaries from here 
> http://dbtg.thresher.com/derby/bits/
> Note that these are bits used for the nightly testing and should *not* 
> be used in production without verification and testing.
>
> Note that the performance problem in this case is severe; the larger the
>
> Clob the worse the impact (we're talking hours instead of 
> seconds/minutes). I would strongly suggest you test with a newer, though
>
> unreleased, version.
>
>
>   


Mime
View raw message