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: Howard J. Rogers <hjr_at_dizwell.com>
Date: Wed, 05 May 2004 21:46:30 +1000
Message-ID: <4098d412$0$12740$afc38c87@news.optusnet.com.au>


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

It doesn't answer your specific questions, and is only one pointer, and not particularly good news at that, but there's a new article on identifying useful versus useless indexes on www.dizwell.com (FAQ basic admin).

With regard to the optimiser changing plans when you add in a new column, you don't say what version, but if it's 9i then that's almost certainly because it is indeed cheaper to do the full scan rather than use the index. In your specific first question, your query A1 can be answered entirely from within the index (which are invariably going to be smaller than the tables they're built on, and hence take less I/O to scan). But as soon as you introduce the new column, you're going to have to visit the table anyway, and your query is selecting all rows from the table, so you're going to have to visit all of it anyway. Well, if you're going to have to visit all of the table regardless, why take a detour to an index in the first place?

Regards
HJR Received on Wed May 05 2004 - 06:46:30 CDT

Original text of this message

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