-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Slow blob fetch into java procedure #4
Comments
@AlexBekhtin can you please test Jaybird 3 with embedded connection string in standalone application? By your code looks like as this should be registered in Jaybird project. Maybe @mrotteveel knows something about. |
Jaybird is currently allocating a new I will see if I can reproduce the performance problem with native or embedded and investigate options to alleviate that. |
Just did a quick test on Jaybird 3 (HEAD of master) with a 6MB (binary) blob. Retrieval with PURE_JAVA is +/- 100ms, NATIVE = +/- 200ms, LOCAL = +/- 75ms, EMBEDDED +/- 50ms. So from a perspective from Jaybird everything seems fine. I will test this weekend if I can reproduce it with fb/java. |
I tested again and have no difference (isql embedded connection + jaybird 3.0.0-SNAPSHOT). I tried to re-write the code: FBBlob blob = (FBBlob) blob_object;
// java.sql.Blob blob = (java.sql.Blob) blob_object;
if (true) {
throw new Exception("blob length is " + Long.toString(blob.length()));
}
byte[] bytes_data = blob.getBytes(1, (int) (blob.length())); // TO SLOW and have new abnormal result select * from java_split((select list(word,',') from words_test), ',')
-- java.lang.Exception: blob length is 6645056
-- it's correct size. In the first time I tasted like this
recreate table blob_table (
blob_field blob sub_type text
);
insert into blob_table
select list(word,',') from words_test
select * from java_split((select blob_field from blob_table), ',')
-- java.lang.Exception: blob length is 4287993088
-- ???
execute block as
declare variable cnt int;
declare variable blob_data blob sub_type text;
begin
select blob_field from blob_table into :blob_data;
select count(*) from java_split(:blob_data, ',')
into :cnt;
end
-- java.lang.Exception: blob length is 4287993088 |
I also have spurious results when trying to use this on blobs from a table. It looks like the reported length is wrong for those blobs. |
in DB:
Java:
then call
env:
java 8
jaybird 2.2.10
The text was updated successfully, but these errors were encountered: