Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Any way to speed this select?
Message
De
26/05/2006 09:16:46
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01125229
Message ID:
01125231
Vues:
17
>Hi everybody,
>
>This is the code in the VFP database stored procedure. It takes ~30+ sec. to execute on the Network database. Do you see ways to make it quicker?
>
>
>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 EQS.tScheduled_time <= m.ltTime  ;
>	and TEQ.iActive_Flag = 1 ;
>	and EQS.iActive_Flag = 1  and ;
>	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
>
>
>Thanks a lot in advance.

Nadya,

If it is for a report (i.e., read-only), you might try breaking it into pieces - for instance, first do one inner join, and then (with the result) the other inner join.

I sometimes got drastic improvements with this technique.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform