Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: index is not used when exists clause is used

Re: index is not used when exists clause is used

From: Noel <tbal_at_go2.pl>
Date: Mon, 17 Nov 2003 14:15:35 -0000
Message-ID: <bpahi0$78h$1@inews.gazeta.pl>

Uzytkownik "Pan Yang Bin" <panyb_at_hotmail.com> napisal w wiadomosci news:f258af3d.0311170134.6ed1dde7_at_posting.google.com...

>

> So can anybody tell me why index I1 was not used in the SQL--UPDATE
> when I use EXISTS? I also try to add hint /*+ index(t1 f1) */ after
> UPDATE or SELECT(before 1), the index was still not used. How can I
> use index I1 in my UPDATE?

 exists is fired for each row, no matter there are any indexes.

 update t1
  set f2 = 'abc'
  where t1.f1 in ( select t2.t1f1 from t2 where t2.f1 = 1);

--
Noel
Received on Mon Nov 17 2003 - 08:15:35 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US