recommended settings for lookup fields

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Ludek
Posts: 296
Joined: Thu 12 Oct 2006 09:34

recommended settings for lookup fields

Post by Ludek » Wed 07 Oct 2015 11:33

Hello,
I'm trying to find the optimal way to set up my lookup fields:

my lookup dataset has key = integer, value = string, ca. 2000 records.
if i use it with default properties, everything is extremely slow (calling an .append on dataset with such lookup field takes 3 milliseconds etc.)

I have found 2 options to make it faster:
1. set lookupcache = true for the lookup field
2. setting indexfieldnames in the lookup dataset to the key field

what is the best setup in your opinion? 1 or 2 or combination of both? or even anything else/more?

Thanks for your ideas,
Ludek.

azyk
Devart Team
Posts: 1057
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: recommended settings for lookup fields

Post by azyk » Fri 09 Oct 2015 12:41

1. LookupCache is a property of the TField standard class. So please contact Embarcadero developers concerning its usage.

2. The IndexFieldNames property value sets local sorting order of data in the dataset. Lookup fields must work faster when data is ordered by lookup keys in the lookup dataset.

3. Try to set the TMSQuery.Options.CacheCalcFields property of the dataset to True. This may speed up performance of lookup fields as well.

You can test the above approaches both separately and together in order to find the best solution.

Ludek
Posts: 296
Joined: Thu 12 Oct 2006 09:34

Re: recommended settings for lookup fields

Post by Ludek » Mon 12 Oct 2015 11:42

Thanks especially for the 3rd idea :)

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: recommended settings for lookup fields

Post by AlexP » Thu 15 Oct 2015 13:12

You are welcome. Feel free to contact us if you have any further questions.

Post Reply