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: Why are optimizer hints required?

Re: Why are optimizer hints required?

From: Noons <wizofoz2k_at_yahoo.com.au>
Date: 8 Mar 2005 22:44:13 -0800
Message-ID: <1110350653.144156.193000@g14g2000cwa.googlegroups.com>


The House Dawg wrote:
> Are there ways to ensure that when SQL has been put into production
and
> is using indexes that the SQL doesn't eventually degrade into full
> table scans?

See here:
http://www.stanford.edu/dept/itss/docs/oracle/9i/server.920/a96533/outlines.htm (watch the wrapping)

for "plan stability". DAGS on the same string and see the references. This works. If it is too complex, then you can try to snapshot stats and reset them for the relevant objects as described in Jonathan's reply. Interestingly, this is a technique that Jonathan called "cheating" not so long ago. But it works and works good.

If all else fails then there are ways of writing hints without explicit names for anything and yet still make them work. But you need to change how you write SQL. Mostly, you need to associate a table alias with every table in every SQL statement. Then you can use the alias to hint for index usage, rather than explicit index names. This will bypass SOME of the problems. But it is far from perfect. Received on Wed Mar 09 2005 - 00:44:13 CST

Original text of this message

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