Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Locate or Seek?
Message
De
04/05/1999 00:23:36
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00214836
Message ID:
00214842
Vues:
19
>Greetings Distinguished People!:D
>
>I'm pondering something, which is better to use? Locate or Seek? I've come upon this because I'm trying to use Locate to move to the proper record, but for some reason (even after I set the ORDER to the index that I'm trying to locate on) It's EXTREMELY SLOOOOOWWWW. Should I be using Seek instead? Any coments, thoughts?
>
>Thanks as always...

LOCATE and SEEK are both Rushmore optimizable, and in single uses will be nearly indistuishable as far as performance differences. If you LOCATE is slower tan your seek, it is because te expression you trying to locate for is not optimizable.

The only reason that SEEK is faster than LOCATE in tight loops is that when you issue LOCATE, Rushmore has to scan the index to see if the expression you are LOCATEing for matches an existing index. When you issue a SEEK, you tell Rushmore what index to use either in a parameter or by virtue of having an order set on the table already, so the extra anlyzing effort is unneeded.

I almost always use LOCATE outside of loops because it is not dependent on the existence of an index, and that's one less thing that can break. But this is just personal coding preference.

BTW, the current ORDER setting on a table cannot screw up either a SEEK or a LOCATE, unless your SEEK is assuming a different index is active.
Erik Moore
Clientelligence
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform