Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: stored outlines used but wrong plan executed
Note in-line
-- Regards Jonathan Lewis http://www.jlcomp.demon.co.uk/faq/ind_faq.html The Co-operative Oracle Users' FAQ http://www.jlcomp.demon.co.uk/seminar.html Optimising Oracle Seminar - schedule updated Sept 2nd "Arik" <arik_samson_at_excite.com> wrote in message news:699f12fe.0409181843.6116c93d_at_posting.google.com...Received on Sun Sep 19 2004 - 00:49:36 CDT
>
> The way I dit it was first create outline on the original query with
> "alter session set create_stored_outlines=<category>. Then I created
> another outline in the same category with "create or replace
> outline...." on the same query but with a hint. Afterwords I swapped
> the ol$hints lines between the two outlines so that the original query
> ended up with the hints from the modified query.
> The second query (with the hint) picks up an index and runs in a
> jiffy. The one without the hint does a full table scan and it keeps
> scanning even with the outline.
>
This method is not guaranteed to work on Oracle 9. (And if you got the idea from a Metalink note, the method is incompletely described even for 8i), How are you checking to see if Oracle picked up the hacked outline ? Did you mark it as unused, then see if it changed to 'used' after the call to the original statement ? Did you check in v$sql to find the SQL and see if the OUTLINE_CATEGORY on v$sql showed that the outline has been used.