Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread Slow Locate
Wed, Jan 25 2006 1:45 AMPermanent Link

Dave
Hi

I've been profiling my app to try and speed it up and was surprised to find one of the slowest part of my applications was due to a locate that is frequently used:

 bFound:=tblABC.Locate(tblABCDate.FieldName+';'+tblABCGroup.FieldName,vararrayof([EntryDate,iGroup]),[]);

tblABCDate is a Date field with a secondary index
tblABCGroup is an Integer field with a secondary index


Each locate is taking 2 seconds on average when tested with a table of 1300 records.

(I checked with DBSys to ensure both fields are shown as "Optimized", and even tried reparing and optimizing the table.  Also the table is not displayed anywhere)

DBISAM 3.30, d5.01


Any ideas what might cause such a slow locate?


TIA

Dave
Wed, Jan 25 2006 8:14 AMPermanent Link

Sean McCall
Dave,

Have you tried a single index of Date + Group or Group +
Date. The locate should then do the equivalent of a FindKey,
but if not, a FindKey would be the fastest way to move to
the record.

Sean

Dave wrote:
> Hi
>
> I've been profiling my app to try and speed it up and was surprised to find one of the slowest part of my applications was due to a locate that is frequently used:
>
>   bFound:=tblABC.Locate(tblABCDate.FieldName+';'+tblABCGroup.FieldName,vararrayof([EntryDate,iGroup]),[]);
>
> tblABCDate is a Date field with a secondary index
> tblABCGroup is an Integer field with a secondary index
>
>
> Each locate is taking 2 seconds on average when tested with a table of 1300 records.
>
> (I checked with DBSys to ensure both fields are shown as "Optimized", and even tried reparing and optimizing the table.  Also the table is not displayed anywhere)
>
> DBISAM 3.30, d5.01
>
>
> Any ideas what might cause such a slow locate?
>
>
> TIA
>
> Dave
>
Wed, Jan 25 2006 6:54 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Dave,

<< I've been profiling my app to try and speed it up and was surprised to
find one of the slowest part of my applications was due to a locate that is
frequently used:

 bFound:=tblABC.Locate(tblABCDate.FieldName+';'+tblABCGroup.FieldName,vararrayof([EntryDate,iGroup]),[]);

tblABCDate is a Date field with a secondary index
tblABCGroup is an Integer field with a secondary index

Each locate is taking 2 seconds on average when tested with a table of 1300
records. >>

It sounds like it is using brute-fore for the search.   How long does a
filter of:

DateField='DateConstant' and IntegerField=IntegerConstant

take to execute on the same table ?

--
Tim Young
Elevate Software
www.elevatesoft.com

Image