IBDAC vs IBX is slow (Fix included)

Discussion of open issues, suggestions and bugs regarding IBDAC (InterBase Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
BlueMoon
Posts: 12
Joined: Tue 30 Mar 2010 17:22

IBDAC vs IBX is slow (Fix included)

Post by BlueMoon » Thu 27 Jan 2011 10:42

Hi,

I am using a firebird db with IBDAC on a server via TCP. The db has 20000 records. With IBDAC a sql select and a jump to the last record has a duration of 67 seconds. With IBX (included with delphi) it only takes 4 seconds.

I am using TIBCQuery, TIBCConnection, TDataSource, TDBGrid. Just drop the components from the component palette to the form. No settings are changed (except dbname and serverIP)

Code: Select all

  DB.Connect;
  IBCQuery1.SQL.Text := 'select * from mytable;
  IBCQuery1.Prepare;
  IBCQuery1.Open; 
If I set both CacheArray := false; and CacheBlobs := false;
then IBDAC has the same speed. Why? Is this a bug?

If I set only DeferredBlobRead to True then IBDAC has the same speed too. What does DeferredBlobRead do?

Which solution is better? CacheArray+CacheBlobs or DeferredBlobRead? What are the pros and cons of each solution?

Thanks!

AndreyZ

Post by AndreyZ » Fri 28 Jan 2011 09:59

Hello,

The CacheArray, CacheBlobs, DeferredBlobRead, and DeferredArrayRead options manage the way of working with BLOB and array content. If the CacheBlobs property is set to True, then local memory buffer is allocated to hold a copy of the BLOB content. If the DeferredBlobRead property is set to True, all BLOB values are only fetched when they are explicitly requested. To get the highest performance you should set DeferredBlobRead to True and CacheBlobs to True. In this case only requested portions of data will be fetched from the server. It's the same with the CacheArray and DeferredArrayRead options. For more information please read the IBDAC documentation.
Last edited by AndreyZ on Fri 28 Jan 2011 15:31, edited 1 time in total.

BlueMoon
Posts: 12
Joined: Tue 30 Mar 2010 17:22

Post by BlueMoon » Fri 28 Jan 2011 11:53

OK, thank you very much!

Post Reply