Hello,
I have two tables that are quite big. The first one has 1 million rows and the second around 2 million.
My problem is that when i update oracle ignores the index that i have created.
My query is like:
update table1 a
set
(a.col1 , a.col2)
=
(select b.col1, b.col2
from table2 b
where b.col3 = a.col3)
where exists (select * from table2 b where b.col3 = a.col3);
if i remove the where exists clause the index works fine but with the where exists clause oracle does a full scan on both tables.
Any idea why this happens and any solution??
Thanks,
Fotis
I have two tables that are quite big. The first one has 1 million rows and the second around 2 million.
My problem is that when i update oracle ignores the index that i have created.
My query is like:
update table1 a
set
(a.col1 , a.col2)
=
(select b.col1, b.col2
from table2 b
where b.col3 = a.col3)
where exists (select * from table2 b where b.col3 = a.col3);
if i remove the where exists clause the index works fine but with the where exists clause oracle does a full scan on both tables.
Any idea why this happens and any solution??
Thanks,
Fotis