Salut à tous,
ci-dessous une requête qui s'exécute bien trop lentement.
Dans 90% des cas, cette requète contiendra en plus la clause AND INC.SGR_INC =?
Pouvez-vous me dire comment vous positionneriez des index pour améliorer les choses ?
Merci d'avance.
SELECT INC.ID_INCIDENT AS INCIDENT,
INC.SGR_INC AS SGR,
INC.ANNEE_INC AS ANNEE,
INC.NDEF_ANNEE_SGR AS NUMERO,
EXP.PRODUIT AS REF_PRO,
EXP.FOURNISSEUR AS COFOR,
EXP.GA AS GA,
GMR.GM AS GM,
DEF.ID_ETAT_DEF AS ETAT_DEF,
INC.ETAT_SQI AS ETAT_SQI,
INC.DEMERITE AS DEMIF,
INC.ID_CREATEUR AS CREATEUR,
EXP.ID_FAMI_DEF AS FAMILLE_DEF,
SUBSTR(DTD.LIBELLE,1,10) AS TYPE_DEF,
SUBSTR(DPD.LIBELLE,1,15) AS PRECISION_DEF,
INC.DATE_INCIDENT AS DATE_CREATION,
EXP.FLAG_FNR_INT AS FLAG_FNR_INT
FROM XMUEII.ADFQTINC INC,
XMUEII.ADFQTEXP EXP,
XMUEII.ADFQTGMR GMR,
XMUEII.ADFQTDEF DEF,
XMUEII.ADFQTDTD DTD,
XMUEII.ADFQTDPD DPD
WHERE (INC.DATE_INCIDENT BETWEEN '2002-11-09' AND '2004-07-02' OR INC.DATE_INCIDENT IS NULL )
AND DTD.LANGUE='fr'
AND DPD.LANGUE='fr'
AND EXP.ID_GM=GMR.ID_GM
AND INC.ID_DEFAILLANCE=DEF.ID_DEFAILLANCE
AND EXP.ID_TYPE_DEF=DTD.ID_TYPE_DEF
AND EXP.ID_PREC_DEF=DPD.ID_PREC_DEF
AND INC.ID_EXPERTISE=EXP.ID_EXPERTISE
ORDER BY DATE_CREATION DESC
FOR FETCH ONLY OPTIMIZE FOR 10 ROWS