Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Speed issue: Set Relation .vs. Set Filter .vs. Select &
Message
From
16/10/1997 17:35:00
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
16/10/1997 17:08:45
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00055022
Message ID:
00055032
Views:
33
>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.

Hi Peter,
First of all I think a REPLACEMENT for REPLACE would be faster. If calculated and replaced fields won't be edited setting a view would be the fastest. If in your case REPLACE is a necessity :
1) Set filter is worst. I better think this command had never existed. If you use it, you would add extra workarounds for optimization. ie: set order tag and locate - instead of go top or set order tag descending and locate for go bottom... etc.
2) Set relation was good in old days. But in buffering modes you don't get your relations as simple.
3) scan...endscan is highyly optimized, but *for* slows down it.
4) Seek as in good old days still is the fastest. Combining seek and scan while...endscan could be best performance.

But better yet instead of batch processing on a set of records, updating during data entry (valid, lostfocus, interactivechange, programmatic change etc.) could be the fastest for it would require much less update.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform