Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: SQL Tuning Question (8.1.7)
Jeremy wrote:
> Hi Guys, what's the best resource (on the web) to look at for info on
> tuning SQL and defining suitable indexes for a query (at this point I
> expect someone to say you don't create indexes for a query, they should
> be a part of the overall application design)? I am
>
> A couple of specific questions:
> 1) I do an explain of a query such as
> select a.tab1.id
> from tab1 a, tab2 b
> where a.id = b.id
Why are you selecting from TAB2 B
when NOTHING from that table is actually being returned.
ONLY tables which contribute 1 or more columns to the SELECT clause
should exist in the FROM clause.
select a.tab1.id
from tab1 a
where exists (Select '1'
FROM tab2 b WHERE a.id = b.id)Received on Wed May 05 2004 - 19:28:38 CDT