Subject Re: [IBO] Performance of Locate
Author Jason Wharton
Set FetchWholeRows to true and see what it does.

--
Jason Wharton
CPS - Mesa AZ
http://www.ibobjects.com


<rvellacott@...> wrote in message
news:9q43cs+h90t@......
> I am getting some funny performance issues with Locate.
>
> I open an IBOQuery in a VCL DBgrid, with about 2500 records.
> AutoFetchAll and FetchWholeRows are set to false.
>
> Running the following three commands consecutively works just fine,
> with good performance..
>
> MyQuery.Locate('ITEM_NO','A',[loPartialKey,loCaseInsensitive]);
> MyQuery.Locate('ITEM_NO','Z',[loPartialKey,loCaseInsensitive]);
> MyQuery.Locate('ITEM_NO','A',[loPartialKey,loCaseInsensitive]);
>
> But then I try going back to Z.
>
> MyQuery.Locate('ITEM_NO','Z',[loPartialKey,loCaseInsensitive]);
>
> and this time it takes 20 - 30 seconds.
>
> If I call MyQuery.RefreshKeys before each time before I call Locate,
> it performs fine.
>
> So what is happening here? Is it necessary to call RefreshKeys, or is
> there a better way?