cost based optimizer

From: Chris Xia <xia__chr_at_tasb.org>
Date: 1996/02/05
Message-ID: <4f5clj$6gd_at_gatekeeper.tasb.org>#1/1


In article <DM2GFI.8Gw_at_iquest.net>, parbha_at_iquest.net (New Age) writes:
> In ORACLE Ver 7.02, Which is best : Cost based or Rule based query. I
> have a rule based statement which executes faster than cost based
> query. Has ORACLE really implemented Cost based sql query or they
> fooling around ?
>
> Has anyone faced this problem. I may be wrong in my above statements.
>
> prabha
> prabha_at_lilly.com (office)
> parbha_at_iquest.net (home)
>

About cost based optimizer, there is one thing you need to do to make it smarter. that is : you need to run analyze on the tables you are querying. lacking of the statistics could hamper the ability of cost-based optimizer.

The rule of thumbs is (according to the book ORACLE performance tuning by Peter Corrigan and Mark Gurry): if you have a query which is fine-tuned for the rule-based, then give it a hint, otherwise, use cost-based optimizer. ( and don't forget to run analyze ).

Chris Received on Mon Feb 05 1996 - 00:00:00 CET

Original text of this message