Are FireDAC data access components slower than dbExpress?

I migrated the database access components in our Delphi XE5 application from DBExpress to FireDAC.

So when I was using TSQLConnection / TSQLDataSet, now I am using TFDConnection / TFDQuery.

My observation so far is that it takes about twice as long to return 125,000 rows of data (via a simple SELECT * query) from our SQL Server 2014 database in the cloud to the client application using FireDAC components and using DBExpress components.

When I run the same test on the same table, with both the application and the SQL server on the same machine, the FireDAC components are slightly faster.

Is this normal, or is there something I might be doing wrong? I am not very familiar with FireDAC components, so any pointers would be very helpful.

DBExpress code:

SQL_dataset:=TSQLDataSet;

....

SQL_dataset.CommandType:=ctQuery; 
SQL_dataset.CommandText:='SELECT * FROM TABLE';

SQL_dataset.Open;

If SQL_dataset.IsEmpty=False then 
begin 
  SQL_dataset.First;

  While not SQL_dataset.Eof do 
  begin
    { RETURN THE RECORDS }
    SQL_dataset.Next;  
  end;
end;

      

FireDAC code:

SQL_query:=TFDQuery;

...

SQL_query.SQL.Text:='SELECT * FROM TABLE';
SQL_query.Open;

      

... then according to the DBExpress code.

Based on online research, I've tried variations of the following, but nothing seems to matter much:

SQL_query.ResourceOptions.ParamCreate  :=False;
SQL_query.ResourceOptions.ParamExpand  :=False;
SQL_query.ResourceOptions.MacroCreate  :=False;
SQL_query.ResourceOptions.EscapeExpand :=False;
SQL_query.ResourceOptions.DirectExecute:=True;
SQL_query.FetchOptions.CursorKind      :=ckDefault;
SQL_query.FetchOptions.Mode            :=fmOnDemand;
SQL_query.FetchOptions.RowsetSize      :=1000;
SQL_query.FetchOptions.Unidirectional  :=True;
SQL_query.FetchOptions.Items           :=
                                      SQL_query.FetchOptions.Items-[fiMeta];
SQL_query.UpdateOptions.ReadOnly       :=True;
SQL_query.DisableControls;

      

Any advice or comments would be much appreciated.

+3


source to share





All Articles