Looks like my manager found a huge improvement even in his local environment.
Basically, VFP is supposed to find best plan internally. In other words, why flipping tables around gave such an improvement?
>>I DID IT!!!!!!! ????
>>
>>
>>TEXT TO lcSQLStr NOSHOW TEXTMERGE PRETEXT 7
>> SELECT Trans_Employees_Queues.cTrans_Employees_Queues_pk , ;
>> Trans_Employees_Queues.cCommission_Owner_UsGrLink_fk as cUsGrlink_pk ;
>> FROM Trans_Employees_Queues ;
>> INNER JOIN Employee_queue_schedules ;
>> ON Trans_employees_queues.cTrans_employees_queues_pk = ;
>> Employee_queue_schedules.cTrans_employees_queues_fk ;
>> inner join Trans on Trans_Employees_Queues.cTrans_fk = Trans.cTrans_pk ;
>> and Trans.cResolution_Codes_fk is NULL ;
>> WHERE <<m.lcFilter>>
>>ENDTEXT
>>
>>In other words, changing the order of tables seems to give a great impact on performance. This query ran in 5 seconds.
>
>Congratulations! Of course, it looks like you simplified the query at the same time as you are no longer checking the status of iActiveFlag. Or are you doing that in lcFilter?
>
>Regards,
If it's not broken, fix it until it is.
My Blog