Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Speeding up search - Locate For or Seek?
Message
 
À
28/07/2000 05:18:56
Mike Yearwood
Toronto, Ontario, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00397065
Message ID:
00398269
Vues:
32
Hi Mike,

Actually, I was opening and closing the index with SEEK to try and make a fair comparison with LOCATE. My thought was that in code you can just do a LOCATE, but to do a seek you first have to set the order of the table. Anyway, someone else pointed out that SEEK has an optional ORDER clause, as in SEEK 699 ORDER pID. This is quite a bit faster than using just SEEK. Also, it turns out that SEEK is slowed if TALK is ON, but SEEK ... ORDER is not.

>>>
> FOR lnJ = 1 TO 10000
> SET ORDER TO pID
> SEEK(699)
> SET ORDER TO
> ENDFOR
>>>
>
>Hi Brien.
>
>I wouldn't include the set orders in the above code snippet. You already set it before starting this loop. Further, this makes your test not merely compare SEEK against LOCATE.
>
>Try adding SET COLLATE TO "MACHINE" before doing this. SP4 supposedly defaults to something else (?)
>
>SEEK should be way faster than LOCATE.
Brien R. Givens

Brampwood Systems
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform