Problème temps exécution update
Bonjour,
J'exécute la requête suivante sur deux bases ayant la même configuration mais une est en 9.2.0.6 et l'autre en 9.2.0.8 :
Sur la base 9.2.0.8, le temps d'exécution est de 10s alors que sur la base 9.2.0.6, il est de 45 mn.
Code:
1 2 3 4 5 6 7 8 9 10 11
| update prevision p
set refcon = (select /* HINT 26 */ /*+ INDEX_DESC(H I_HISTOMVTS1) */ decode(min(refcon), max(refcon), min(refcon), NULL)
from histomvts h
where h.ajustement = -1
and h.mvtident = p.mvtident
and nvl(h.refMvtBack, 0) = nvl(p.refMvtBack, 0)
and h.type = p.type
and nvl(h.contrepartie, 0) = nvl(p.contrepartie, 0)
and h.quantite * p.quantite >= 0
and h.dateneg = p.dateneg)
where 1 <> -nvl(to_create, 0) |
Pour remédier au problème, je suis obligée de modifier la requête de cette façon :
Code:
1 2 3 4 5 6 7 8 9 10 11
| update prevision p
set refcon = (select /* HINT 26 */ /*+ INDEX_DESC(H I_HISTOMVTS1) */ decode(min(refcon), max(refcon), min(refcon), NULL)
from histomvts h
where h.ajustement = -1
and h.mvtident = p.mvtident
and nvl(h.refMvtBack, 0) = nvl(p.refMvtBack, 0)
and h.type = p.type
and nvl(h.contrepartie, 0) = nvl(p.contrepartie, 0)
and h.quantite * p.quantite >= 0
and h.dateneg = p.dateneg)
where 1 <> -nvl(to_create, 0) |
Je cherche une autre solution, j'ai reconstruit les index de la table histomvts sans résultat.
Merci
Bonne journée
Brigitte