Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Locate For vs Seek
Message
De
20/11/1997 16:35:53
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00061465
Message ID:
00061482
Vues:
35
>Here's the problem. I have an integer field that I am seeking against. The field has a tag. The table I am using has 12300 records. When I use Locate For fld = exp and there is an 8 second delay. Each proceeding call to the same Locate For is almost instantaneous. If I set an order and seek the value the seek is almost instantaneous.
>
>Now using private data sessions. Every time I use that Locate For within my search form which uses the Locate For, there is an 8 second delay. Again using seek I get instantaneous results. Character fields the Locate For works the same as the seek.
>
>
>USE LM01
>LOCATE FOR lm01.IPAGENO = 1500
>
>USE LM01 ORDER PAGENO
>SEEK 1500
>
>Am I doing something wrong here or are other people experiencing the same slow down.

seek uses the index tag and I believe locate checks each record for a match. I don't know what other peaple do but I try to use seek as much as possible. If I absolutely need to use a locate I try to use the seek first to get me close.

use Mytable order MyTag
seek MyVal1
Locate for field1 = MyVal1 and field2 = MyVal2 while field1 = MyVal1 rest

The WHILE clause minimizes the records the locate accesses when it has checked all records that satisfy the first condition.
The REST clause stops the locate from begining at the first record again.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform