Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: SQL Tuning
Roman Gelfand <rgelfand_at_masmid.com> wrote:
>I am trying to tune an sql statement by manipulating initialization
>parameters, indexes... etc. These SQL statements are vendor supplied and I
>am not at liberty to change them....
Hi Roman,
combining the information provided in your postings ( the explain plan, view definition, and index definitions ), this is how I think the optimiser is processing your query ...
(in the following, FTS = "Full table scan" and TSP = "TABLE_SITE_PART" )
You claim that your problem is a FTS on TABLE_SITE_PART. This isn't true: your explain plan doesn't show a FTS on TABLE_SITE_PART ( perhaps you misread the FTS on TABLE_SITE ).
Your real problem is that the optimiser has "optimised" the query in an almost diametrically opposite way to that required to produce an efficient result. Note that your condition S_X_NAME like BWILLIAMS% isn't taken into account until step (7), so all the prior steps are acting on all rows in the tables concerned.
An obvious observation is that there is no index on TABLE_PRODUCTBIN.S_X_NAME. Creating one may help the optimiser to invert the query plan to produce an efficient result. Your aim (probably) is to get the condition S_X_NAME LIKE 'BWILLIAMS%' evaluated early on in the execution plan so that it drives the query. Be aware though that adding indexes may cause the optimiser to optimise other queries in a different way, possibly resulting in them going slower.
HTH, Dave.
--
Remove the no-spam bit from my email address to reply.
Received on Sat Nov 07 1998 - 15:59:31 CST