>Hi George
>
>>>How may records are you using in your search. I'm guessing that the difference I see is caused by increased record pointer thrashing while it tries to resolve the bitmap against the ordered table. I've got 1 million records in my test table.
>>
>>As I stated in my original post, there were only 493 records records (unordered) in the table.
>
>Aha.. This explains your results. The LOCATE without an index set might be faster because it takes less time to look trough the table sequentially than to kick in rushmore.
LOCATE was faster with the index set.
>Therefore it may be wise to use NOOPTIMIZE when locating a record in smaller tables. Just try the same with a table with a 10.000 - 1.000.000 records or so.
>
FWIW, I use LOCATE only when dealing with small subsets of data, usually retrieved via a query and there are multiple fields involved. I do have a situation where I have to retrieve between 1,000 and 2,000 records (ordered by a single field) from SQL server, and I need a fast method of retrieving them. I don't use SEEK, I don't use LOCATE. I don't use SEEK because of the additional overhead of generating the INDEX. I don't use LOCATE because it's not fast enough. I use a binary search routine written in Fox. While not as fast as SEEK, it's faster than LOCATE.
George
Ubi caritas et amor, deus ibi est