Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Speeding up search - Locate For or Seek?
Message
 
À
27/07/2000 14:27:07
Walter Meester
HoogkarspelPays-Bas
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00397065
Message ID:
00397783
Vues:
26
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform