Subject Re: [Firebird-Java] Re: Blob Performance hints?
Author Rick Fincher
William replied:

> > Anybody have any hints on how to improve performance?
>
> Yes, make sure the blob segment size in the db is larger than the
> largest blob if possible. I noticed a slight difference in performance
> when I did that.

I'll keep that in mind for other programs but unfortunatlty this one is
storing documents that are as large as 20 meg.

> I would try using rs.getString and see if you notice a performance diff.

Are you using subType 0 (bin) or 1 (text)? I initially created the blob
field as subType 0, will this cause problems with rs.getString?

As an aside, is there any implication to using 20 meg strings? Can a string
be that large?

Roman also replied:

> What exactly throughput you get? I would expect something around
> ~2-2.5 MB/s on big chunks of data.
>
> > Should I increase the initial size of the byte array and/or match it
> > to multiples of the block size of the blob's database?
>
> Should not be an issue. FBBlob uses BufferedInputStream with buffer
> length you specify in connection params.
>
> Check if ResultSet.getBytes(int) works faster (only as a test).

I was getting about 0.2 meg per second. After I tried this it increased to
about 1.0 meg per sec.

I think the rest of the difference can be attributed to the overhead of the
servlet engine, etc.

Why did you say to use only use ResultSet.getBytes(int) as a test? Is there
a problem with using it?

Thanks for the solutions!

Rick