Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Speed issue: Set Relation .vs. Set Filter .vs. Select &
Message
From
17/11/1997 09:35:03
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
15/11/1997 12:04:10
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00055022
Message ID:
00060653
Views:
42
Hi Vlad,
As you also said if it can not use an index tag than it is not Rushmore optimizable.
Rushmore is a method that takes your expression and checks it against your existing tags,
if one is found it uses this tag, right ?
Now if you have many tags, checking for a match has an overhead before actual search.
If you use alrady optimized (by yourself of course) expressions you know the tag,
than why you should use Rushmore, set order by yourself, it is faster, just add another line of code.
A neat example ;
You have 100000 records containing addresses, you have, say 100 tags. You wan't to get all persons
with Lastname = "Jones". Unfortunately you have a tag on Lastname + Firstname but not just on Lastname.
How would you set the expression ? Of course as Lastname+Firstname = "Jones", right ?
This would be the case with or without Rushmore.
Without Rushmore
set order to tag lfname && tag with key lastname+firstname
=seek("Jones")
scan while Lastname = "Jones"
* do nothing or whatever you want
endscan
With Rushmore
scan for Lastname + Firstname = "Jones"
* do nothing or whatever you want
endscan

With Rushmore you need fewer lines, but those 2 extra lines execute absolutely faster if your tag is not
one the first few tags. Fewer the records you benefit more for those extra lines.
The first example *without Rushmore* executes faster (sometimes more than 400%).
Rushmore technique could only be better if you could preassume the queries and set your index tags creation
order for a special purpose, keep your tags a few etc.
The more the tags Rushmore method is slower. Worst if the tag you will be using created last.
So in reality who is optimizing way it works, Rushmore or the way you write your code ?
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