Subject | Re: Firebird 3 and Blob Fields with IBO ! |
---|---|
Author | |
Post date | 2019-03-14T17:57:10Z |
Hi Antonio,
That’s a very good point by Jason.
I also want to add to what Jason says that if you don’t have any parameters in your query you can also skip the explicit Prepare since First is doing that if needed.
Ok, I removed the Prepare and First.
In my experience using TIB_Cursor is extremely fast and very well suited for what I think you are doing.
Two things come to my mind.
1. It’s hard to even guess what happens in AddBiometria and ConverteBiometria perhaps you are doing something there that takes time.
If I remove AddBiometria and ConverteBiometria does not change the performance. The IB_Cursor is fast, it's true. But if comment both functions and I put Fields[1].Asstring the performance is slow down. I Noted that poor speed is when the blob need be loaded. Without assign to any variable, just only load.
2. How are you executing the query in IBExpert?
Make sure that you are comparing apples with apples and not apples with pear by for instance check the settings for “Show text blobs as memo”.
Also, if using “SQL Editor” and you haven’t
enabled “Fetch All” and are doing a simple “Execute (F9)” then only the
necessary records to fill the grid are fetched, try with “Execute and fetch all
(Shift+F9)” and see if there is a difference in performance.
The performance was the same, I'm using remote connect to both applications.
---In IBObjects@yahoogroups.com, <jason@...> wrote :
From: IBObjects@yahoogroups.com [mailto:IBObjects@yahoogroups.com]
Sent: Monday, March 11, 2019 10:36 PM
To: IBObjects@yahoogroups.com
Subject: [IBO] Firebird 3 and Blob Fields with IBO !
Hello,
Could someone show me how to better way of the load with blob Field sub_type 0 ? for example. I have a table with just only 3 fields and 6220 records:
ID INTEGER
TEMPLATE BLOB SUB_TYPE 0
FINGER INTEGER
When I do a query on IBEXPERT is impressive the speed, the result set time is:
Plan
PLAN (ASSOCIADO_BIOMETRIA NATURAL)
------ Performance info ------
Prepare time = 741ms
Execute time = 60ms
Avg fetch time = 5,00 ms
Current memory = 11.439.512
Max memory = 16.698.304
Memory buffers = 2.048
Reads from disk to cache = 0
Writes from cache to disk = 0
Fetches from cache = 2.125
But when I use IBO to load records with Blob Field it's very slow, there are workaround ?
with IB_Cursor_Biometria do
try
SQL.Clear;
SQL.Add('SELECT MATRICULA, DIGITAL_TEMPLATE, DIGITAL_DEDO FROM ASSOCIADO_BIOMETRIA ORDER BY DIGITAL_DEDO DESC, MATRICULA');
Open;
Prepare;
First;
while not eof do
begin
AddBiometria(Fields[0].AsString, ConverteBiometria(Fields[1].AsString),
Fields[2].AsInteger, True, True);
Next;
end;
finally
Free;
end;