Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: How Can I force SQL to use a specific plan?

Re: How Can I force SQL to use a specific plan?

From: Jonathan Lewis <jonathan_at_jlcomp.demon.co.uk>
Date: Wed, 5 Sep 2001 20:44:19 +0100
Message-ID: <999719186.6683.0.nnrp-08.9e984b29@news.demon.co.uk>

If you can interpret the plan correctly, then one option, open to most versions of Oracle would be to re-arrange the order of the tables in the query to match the plan, then use a list of hints, starting with the

    ORDERED
hint, then specifying join types and indexes used in the plan you want.

If you have Oracle 8.1 you can investigate 'stored outlines'. Look up:

    create outline
in the SQL reference manual.

--
Jonathan Lewis
http://www.jlcomp.demon.co.uk

Host to The Co-Operative Oracle Users' FAQ
http://www.jlcomp.demon.co.uk/faq/ind_faq.html

Author of:
Practical Oracle 8i: Building Efficient Databases

Screen saver or Life saver: http://www.ud.com
Use spare CPU to assist in cancer research.

jaimin saraiya wrote in message ...

>Hello,
>
>I have saved a plan using Explain Plan tool. Now I want to force my
>SQL Statement to always use that plan during execution. How can I do
>this?
>
>Thank you
>
>Regards,
>
>Jaimin
Received on Wed Sep 05 2001 - 14:44:19 CDT

Original text of this message

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