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: SQL Tuning Question (8.1.7)

Re: SQL Tuning Question (8.1.7)

From: Anna C. Dent <anacedent_at_hotmail.com>
Date: Wed, 05 May 2004 17:28:38 -0700
Message-ID: <XEfmc.69664$Jy3.11643@fed1read03>


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

Original text of this message

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