Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Speed issue: Set Relation .vs. Set Filter .vs. Select &
Message
De
19/10/1997 17:36:03
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00055022
Message ID:
00055424
Vues:
40
>>>>I want to maximize the speed of performing calculations in related tables. I will be performing a REPLACE on every record in the child table based on values in the Parent record. Any thoughts on the best performers ?
>>>>
>>>>1) Using Set Relation to 'automate' finding records in child tables
>>>>
>>>>2) Using Set Filter to 'manually' SKIP thru records in child tables based on Parent key.
>>>>
>>>>3) Using Scan For in child table based on Parent key.
>>>>
>>>>4) Using good old fashion Seek in the Child table based on Parent key.
>>>
>>>Peter;
>>>Try to stay away from FILTER as much as possible. In dealing with child records, I usually use the SELECT command and include RECNO() as a column. Then use the record number to point directly to the record in the child table.
>>>
>>Oh I like this myself!
>>SELECT RECNO() AS myfield
>>
>>Is that what you mean Kia? That's an interesting approach I have never considered before.
>
>Yes Roxanne, but I'd include the aliase when calling RECNO() such as
>
>SELECT RECNO('child')
>
>This has worked for me reliably in FP 2.6 and haven't personaly seen problems with VFP.

The fact you had no problems with it is just a happening (ie: you were lucky!). Generally, is not good to use RECNO() inside a SELECT SQL. To use it with a parameter: You base your program on your luck and cross your fingers! :)

Vlad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform