Subject Performance of Locate
Author rvellacott@passfield.co.uk
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?