Bonjour à tous,

J'ai une requête update sur une table et elle rame quand je l'exécute, donc je souhaiterais faire intervenir les index.

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
 
Update Table1 tab1
set col1 = (select distinct tab2.col1 from table2 tab2 where tab1.col3 = tab2.col3 and tab1.col4 = tab2.col4)
set col2 = (select distinct tab2.col2 from table2 tab2 where tab1.col3 = tab2.col3 and tab1.col4 = tab2.col4)
where tab1.status = 'NEW'
and nvl(tab1.col6,0) = 1
and exists (select 'x' from table2 tab2 where tab1.col3 = tab2.col3 and tab1.col4 = tab2.col4)
Vous auriez une idée sur la disposition d'index?

Je souligne que la table1 comporte plus de 2 millions de lignes contre 2000 pour la table 2.