Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Sql not picking up primary key index
In your second query you are only asking for the booking id. A select from
the index is all that is needed to satisfy your query, so the CBO uses the
index. In the first query you are asking for the room number. That
information is not in the index so after evaluating how much work it would
be to search all the rows in the join, the CBO determines it is cheaper to
full table scan.
Received on Wed Sep 12 2001 - 10:47:28 CDT