Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: question for the wise?
In article <R9PC8.26941$CN3.821867_at_news2.tin.it>, you said (and I quote):
> So, the original question is still there.
> Is there any way to make the SQL statement above faster avoinding hard-coded
> values?
>
Apart from simplifying the SQL even more (by re-design or re-code) which I won't go into because I don't have the time to analyze it:
1- Use bind variables.
2- If the execution plan starts changing on you (it shouldn't unless you
have histograms active), then use outlines or even hard-coded stats to
pin the execution plan to a constant and predictable behaviour.
Outlines can be used from 8.1.7 onward. In this release there is also a supplied package that lets you get/set the stats in a table. Snapshot the stats when they produce a good execution and reset them if someone does an analyze later on that stuffs the plans up.
-- Cheers Nuno Souto nsouto_at_optushome.com.au.nospamReceived on Fri May 10 2002 - 10:26:41 CDT