Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Any way to speed this select?
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01125229
Message ID:
01125355
Views:
13
>how about:
>
>select count(trans.cTrans_pk) as iAccounts_Count, ;
>	step1.cUsGrLink_pk, ;
>	sum(trans.yCurrent_balance_amount) as yBalance ;
>	from trans ;
>	INNER join ;
>	(select TEQ.cTrans_fk, ;
>	iif(not isnull(TEQ.cCommission_Owner_UsGrLink_fk), ;
>	TEQ.cCommission_Owner_UsGrLink_fk, ;
>	TEQ.cUsGrLink_fk) as cUsGrLink_pk from Employee_Queue_Schedules EQS ;
>	INNER join Trans_Employees_Queues TEQ ;
>	on TEQ.cTrans_Employees_Queues_pk = EQS.cTrans_Employees_Queues_fk ;
>	where TEQ.iActive_Flag = 1 ;
>	and EQS.iActive_Flag = 1  and ;
>      and EQS.tScheduled_time <= m.ltTime
>	iif(not isnull(TEQ.cCommission_Owner_UsGrLink_fk), .t., ;
>	(TEQ.iTemporary_Assignment_Flag = 1 and ;
>	TEQ.tStart_Date <= m.ltTime and ;
>	TEQ.tExpire_Date >= m.tdDate))) step1 ;
>	on trans.cTrans_pk = step1.cTrans_fk ;
>	where trans.cResolution_Codes_fk is null ;
>	group by 2 into cursor (m.tcAlias) readwrite
>
>with making sure that there is an index on step1.cUsGrLink_pk and
>on TEQ.cTrans_Employees_Queues_pk and
>on EQS.cTrans_Employees_Queues_fk and
>on TEQ.iActive_Flag
We don't have indexes on iActive_Flag (it's integer field 1/0). We have other indexes. The Step1 is created on the fly, so it doesn't have indexes. I can create it as a separate step and create an index on it.

The other idea we have is to create DLL on the server to retrieve data. I would have to return it as XML. The resulting file should have ~350 records and 2 fields, so I don't think CursorToXML/XMLToCursor would be slow.

But we're having problem registering DLL on the server.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform