Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Quick retrieval
Message
From
08/02/2000 08:13:38
 
 
To
07/02/2000 20:51:28
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
00327540
Message ID:
00328699
Views:
31
AFAIK, parentheses doesn't prevent Rushmore to kick in. I got into the habit of including parentheses on every expression where more than one condition is required, that way, I'm sure about the order of comparison done by VFP. You have no choce of using parentheses if the expression contain a mix of AND and OR.

There were a big thread here about the use of the Deleted() tag. Many have agreed that it will slow down the query if the ratio non-deleted/deleted is not balance.

OTOH, changing the > comparison to the ABS_DIFF is a good move, since it require one less index.

Real, you might want to check the result of SYS(3054, 11) to see if Rushmore kick in.>First, I think it may be a mistake to include those parentheses in the query. I think that is tricking Rushmore into not trying to optimize. Also, you don't have indexes mentioned for either DELETED() or CL_Code (for the ORDER BY). Here is my first approach to this problem:
>
>INDEX ON FA_GENRE TAG FA_GENRE
>INDEX ON CL_CODE TAG CL_CODE
>INDEX ON ABS(FA_TOTAL)-ABS(FA_ZPAYED) TAG ABS_DIFF
>INDEX ON DELETED() TAG DELETED
>
>Now change your query to exactly:
>
>SELECT * FROM Facture WHERE FA_GENRE = "FA" AND ;
> ABS(FA_TOTAL)-ABS(FA_ZPAYED)>0 INTO TABLE Tmp ORDER BY CL_Code
>
>To further optimize, you can consider removing the ORDER BY and then indexing the result set.
Previous
Reply
Map
View

Click here to load this message in the networking platform