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 -> Newbie: Index Usage

Newbie: Index Usage

From: <mrslacker_at_my-deja.com>
Date: Thu, 11 Nov 1999 21:21:12 GMT
Message-ID: <80fc02$e8b$1@nnrp1.deja.com>


I have a select statement as follows:

select stuff
  from table1, table2

 where table1.x1 in (value1, value2) and
       table2.x2 (+) = table1.x2     and
       table2.x3 (+) = table1.x3;

table1.x1 is indexed not primary. The query is doing a full table scan on table 1. If the outer joins are not present the index is used. Also if the in is not present and = value1 is used,and the outer joins are present it uses the index so a union works. Can anyone explain to me why this happens.

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Thu Nov 11 1999 - 15:21:12 CST

Original text of this message

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