Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How much data returned
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01118142
Message ID:
01118353
Vues:
17
Which part of the query is slow? Is it JOIN, WHERE or GROUP BY?
>
>Here is the particular select that is running too slow :( I'm thinking of removing group by and running group by as the second step.
>
>TEXT TO lcSQLStr NOSHOW TEXTMERGE PRETEXT 7
>    SELECT COUNT(Trans.cTrans_pk) as iAccounts_Count, ;
>           IIF(not IsNull(Trans_Employees_Queues.cCommission_Owner_UsGrLink_fk), ;
>               Trans_Employees_Queues.cCommission_Owner_Usgrlink_fk, ;
>               Trans_Employees_Queues.cUsGrLink_fk) as cUsGrlink_pk, ;
>           SUM(Trans.yCurrent_balance_amount)  as yBalance ;
>    FROM TRANS
>    INNER JOIN Trans_employees_queues   ;
>    ON Trans.cTrans_pk = Trans_employees_queues.cTrans_fk ;
>    INNER JOIN Employee_queue_schedules ;
>    ON Trans_employees_queues.cTrans_employees_queues_pk = ;
>     Employee_queue_schedules.cTrans_employees_queues_fk ;
>    WHERE <<m.lcFilter>> AND
>          IIF(not IsNull(Trans_Employees_Queues.cCommission_Owner_UsGrLink_fk), .T., ;
>              (Trans_employees_queues.iTemporary_Assignment_Flag = 1    AND ;
>               Trans_employees_queues.tStart_Date <= <<m.lcDateTime>>   AND ;
>               Trans_employees_queues.tExpire_Date >= <<m.lcDateTime>>))
>    GROUP BY 2
>ENDTEXT
>SET DELETED off
>llReturn = RunSQL(m.lcSQLStr, m.tcAlias)
>SET DELETED on
>
>As I see, I even tried to play with SET DELETED hoping to optimize it...
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform