OK thanks.
My question arose based on a test that I am doing, which consists of the following:
Code: Select all
procedure TFTest.Test1;
var i: Integer; dTime, dtStart: TDateTime;
begin
dtStart:= Now();
for i:= 0 to 1000 do begin
UniQuery1.Close;
UniQuery1.SQL.Clear;
UniQuery1.Params.Clear;
UniQuery1.SQL.Add('SELECT * FROM TEST_TABLE');
UniQuery1.SQL.Add('WHERE COL1 >= ''2018-08-20 00:00:00.000'' AND COL2 = :pCOL2');
UniQuery1.SQL.Add('ORDER BY COL3 DESC');
UniQuery1.Params.CreateParam(ftString, 'pCOL2', ptInput).AsString:= 'F';
UniQuery1.Open;
While not UniQuery1.Eof do begin
dTime:= UniQuery1.FieldByName('COL1').AsDateTime;
UniQuery1.Next;
end;//While
end;//for
ShowMessage(FormatDateTime('hh:mm:ss.zzz', Start-Now));// 10.5 seconds
end;//Test1
The duration of the previous test is 10.5 seconds. Exactly that same test I did it with a TFDQuery,
and his duarion was 2.5 seconds.
The first difference I found is that the connection of the TFDConnection
it appears to me as ODBC and that of TUniConnection as OLEDB.
I'm interested in the UniDAC components. Any recommendations to configure the TUniQuery?
The TFDQuery configuration is as follows:
TFDQuery:
FDQuery1.FetchOptions.Mode:= fmAll;
FDQuery1.CachedUpdates:= True;
FDQuery1.UpdateOptions.LockMode:= lmNone;
FDQuery1.FetchOptions.AutoClose:= False;
FDQuery1.ResourceOptions.ParamCreate:= False;