Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Lesser records to retrieve - longer time?
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01130252
Message ID:
01130559
Views:
29
>>Does this make any speed difference:
>>
>>ldDate    = DATETIME(3000,1,1,0,0,0)
>>ldExpDate = DATETIME(2006,6,21)
>>
>>select top 200 trans.cTrans_pk, ;
>>       space(16) as cCommission_Owner_UsGrLink_fk, ;
>>       space(16) as cQueue_names_fk, ;
>>       0 as iAssigned, ;
>>       step1.tScheduled_Time, ;
>>       step1.cTrans_Employees_Queues_Pk, ;
>>       step1.tExpire_date ;
>>from trans;
>>;
>>INNER join ;
>>(select NVL(Employee_Queue_Schedules.tScheduled_Time, m.ldDate) as tScheduled_Time,;
>>       Trans_Employees_Queues.tExpire_date,;
>>       Trans_Employees_Queues.cTrans_Employees_Queues_Pk,  ;
>>       Trans_Employees_Queues.cTrans_fk from Trans_Employees_Queues ;
>>;
>>LEFT JOIN Employee_Queue_Schedules ON ;
>>          Trans_Employees_Queues.cTrans_Employees_Queues_pk = ;
>>          Employee_Queue_Schedules.cTrans_Employees_Queues_fk ;
>>          and Employee_Queue_Schedules.iActive_Flag = 1 ;
>>;
>>where Trans_Employees_Queues.cCommission_Owner_UsGrLink_fk IS NULL ;
>>  and Trans_Employees_Queues.cQueue_names_fk = 'E06FDF1EC96545BF' ;
>>  and Trans_Employees_Queues.iActive_Flag    = 1
>>  AND tExpire_date < m.ldExpDate) step1 ;
>>on Trans.cTrans_pk = step1.cTrans_fk ;
>>;
>>where Trans.cDepartment_Code     ='O';
>>  and Trans.cResolution_Codes_fk is NULL;
>>  and Trans.iAccount_locked_flag = 0;
>>  AND Trans.cProduct_Line_Code NOT BETWEEN "600" AND "604";
>>;
>>order by tScheduled_Time, tDate_Received
>>
>
>I see that you moved the Expire date into the inner select. I may try that, but don't think it will make any difference. I may eliminate this whole criterion as it's very unlikely to make an effect (in 99,9999% of the cases the tExpire_date is empty).

Not only. I use variables instead of {^....}
But w/o knowing the date it is very hard to optimize this query :o)
If the data isn't very sensible can you send me these tables to play with them? If you can of course.
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform