| Bonjour,
Lorsque nous lançons un rapport - Agent - Productivité sur un agent pour une période d'un mois nous constatons que la requête ne semble pas aboutir.
Notre DBA a intercepté la requête suivante qui dure ... :
SELECT TO_CHAR (seprev.eventdate, 'HH24'), aseprev.agentnewstate,
SUM (((senext.eventdate - seprev.eventdate) * 86400))
FROM statevent seprev,
agentstatevent aseprev,
statevent senext,
agentstatevent asenext
WHERE seprev.eventkind = 3
AND seprev.eventdate >= :1
AND seprev.eventdate <= :2
AND seprev.stateventid = aseprev.stateventid
AND aseprev.agentnewstate <> 0
AND aseprev.stateventid = asenext.previd
AND senext.stateventid = asenext.stateventid
AND senext.eventdate >= :3
AND senext.eventdate <= :4
AND aseprev.agentid = :5
GROUP BY TO_CHAR (seprev.eventdate, 'HH24'), aseprev.agentnewstate
Est il possible d'optimiser cette requête.
Merci de votre réponse.
Stéphane GUILLOU
Ingenieur Systeme et Messagerie
INGDirect France
xxx@yyy.zzz
tel : +33 (0)1.57.22.55.39
-----------------------------------------------------------------
ATTENTION:
The information in this electronic mail message is private and
confidential, and only intended for the addressee. Should you
receive this message by mistake, you are hereby notified that
any disclosure, reproduction, distribution or use of this
message is strictly prohibited. Please inform the sender by
reply transmission and delete the message without copying or
opening it.
Messages and attachments are scanned for all viruses known.
If this message contains password-protected attachments, the
files have NOT been scanned for viruses by the ING mail domain.
Always scan attachments before opening them.
-----------------------------------------------------------------
|