Walter Meester
HoogkarspelNetherlands
General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
Joe,
>Sometimes, and different situations call for different approaches, it makes sense to do a combination of seek and locate. For instance, this one seek might not be as fast as:
>if seek(3, "TableAlias", "myId")
> locate for myCheckNumber = 5 and between(myDate, dDate1, dDate2) while myId = 3
>endif
That's a good one !!! I never did come to this solution. I did use an empty SCAN WHILE to do the same.
>If the table will have more than a small number of records, this will almost definitely be faster.
>You would probably also want to seek on the most unique key of the conditions. In other words, if there are most likely hundreds of records with myId equaling 3 and only a few records with myCheckNumber equaling 5, you would want to do this instead:
>
>if seek(5, "TableAlias", "myCheckNumber ")
> locate for myId = 3 and between(myDate, dDate1, dDate2) while myCheckNumber = 5
>endif
Hmmm.. Using both FOR and WHILE ? I really doubt if rushmore kicks in here and uses the MyId index. I'd rather choose for making a composite index if speed really is a requirement.
Thanks for the new idea's and insights.
Walter,
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only