Subject | Re: [firebird-support] Blob write to Embedded on Linux performance |
---|---|
Author | Mike Ro |
Post date | 2014-06-07T19:42:12Z |
On 07/06/14 14:42, Frank Schlottmann-Gödde
frank@... [firebird-support] wrote:
Frank, you are absolutely right, how did I miss that!
This is probably the cause of the exception:
> declare external function f_insertblob cstring (20), blob returns int by
> value entry_point 'insertblob' module_name 'test_udf.so';
should be
DECLARE EXTERNAL FUNCTION f_insertblob CSTRING(255), BLOB RETURNS
PARAMETER 2
entry_point 'insertblob' module_name 'test_udf.so'
The function expects to get a blobcallback structure from the server,
"returns parameter 2" lets the engine provide it..
So now the results are very different:
----------------------------------------------------------
SQL> insert into bloby select 5, f_insertblob ('00013.MTS') from rdb$database;
buffer okay
Read a total of 61765632 bytes
Current memory = 817864
Delta memory = 56428
Max memory = 943356
Elapsed time= 0.36 sec
Cpu = 0.00 sec
Buffers = 75
Reads = 8
Writes = 15346
Fetches = 44754
SQL>
----------------------------------------------------------
61Mb in 0.36 secs!!
So for now my problem is solved - thank you very much.
I am still curious why the API is so much slower, but will move the discussion about that to the IBPP list.
Many thanks, Mike.