Clientside Locate, Indexes, Speed, Locate Options

Discussion of open issues, suggestions and bugs regarding PgDAC (PostgreSQL Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
dschuch
Posts: 73
Joined: Thu 05 Feb 2009 15:29
Location: Dresden

Clientside Locate, Indexes, Speed, Locate Options

Post by dschuch » Thu 21 Apr 2016 07:31

Hi,

we have some bigger Clientside DataSets, that hold cached informations, for example FieldStructures and so on. The DataSet can be lets say 20.000 Records.

The Problem is that the Locate Speed is very very slow and so we are looking for a way how to speed up this. It seems there is no option to use Local Indexes for speeding up Locate? Locate calls can be up to 3000 on a Form Creation and it takes nearly one second.

Out current solution is to use a TDictionary and Save the locate Keys and there corresponding RecNo. If the Key is Searched a 2nd one the TDictionary will give back the Recno and so its fast.

Perhaps there is another Solution how to speed up locate?

Code: Select all

CacheGridFilter.Locate('il_group;il_item;gf_minr;gf_default;gf_deleted',
[ClassName, GridFilterSaveName(GridView), NULL, True, False])
Daniel.

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

Re: Clientside Locate, Indexes, Speed, Locate Options

Post by azyk » Tue 26 Apr 2016 14:41

To speed up search, try to use client-side local sorting by fields used in the search. For this, set the list of the fields separated by semicolon in the TPgQuery.IndexFieldNames property in the dataset. For example:

Code: Select all

PgQuery.IndexFieldNames := 'il_group;il_item;gf_minr;gf_default;gf_deleted';
See more details about the IndexFieldNames property in our online documentation: https://www.devart.com/unidac/docs/?dev ... dnames.htm

Post Reply