<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Execution Plan on CBO vs Rule in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/execution-plan-on-cbo-vs-rule/m-p/3373223#M863907</link>
    <description>I think you should only use Choose for some queries but not for the entire database. Cost or Rule are better for the DB optimizer_mode. To use Cost you must compute or estimate statistics...</description>
    <pubDate>Tue, 07 Sep 2004 03:04:02 GMT</pubDate>
    <dc:creator>Eric Antunes</dc:creator>
    <dc:date>2004-09-07T03:04:02Z</dc:date>
    <item>
      <title>Execution Plan on CBO vs Rule</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/execution-plan-on-cbo-vs-rule/m-p/3373222#M863906</link>
      <description>This is Oracle 9.0.1.4.&lt;BR /&gt;The DB optimizer_mode is choose. We analyze all database every week. However, some SQL statement execution time is too long. If we add a hint '/*+ rule */', the execution plan is also changed. Then its execution time became faster than CBO. What's going on? &lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;Eric</description>
      <pubDate>Mon, 06 Sep 2004 22:00:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/execution-plan-on-cbo-vs-rule/m-p/3373222#M863906</guid>
      <dc:creator>ericfjchen</dc:creator>
      <dc:date>2004-09-06T22:00:20Z</dc:date>
    </item>
    <item>
      <title>Re: Execution Plan on CBO vs Rule</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/execution-plan-on-cbo-vs-rule/m-p/3373223#M863907</link>
      <description>I think you should only use Choose for some queries but not for the entire database. Cost or Rule are better for the DB optimizer_mode. To use Cost you must compute or estimate statistics...</description>
      <pubDate>Tue, 07 Sep 2004 03:04:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/execution-plan-on-cbo-vs-rule/m-p/3373223#M863907</guid>
      <dc:creator>Eric Antunes</dc:creator>
      <dc:date>2004-09-07T03:04:02Z</dc:date>
    </item>
    <item>
      <title>Re: Execution Plan on CBO vs Rule</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/execution-plan-on-cbo-vs-rule/m-p/3373224#M863908</link>
      <description>Our DB optimizer_mode is choose. Oracle said CBO is better than rule base. The whole databse is analyzed every week. We also check the table's statistic as below,&lt;BR /&gt;-------------&lt;BR /&gt;select owner,table_name,to_char(LAST_ANALYZED,'YYMMDD') &lt;BR /&gt;from dba_table&lt;BR /&gt;--------------&lt;BR /&gt;The result is expected. We reiterate many queries/DML are fast based on CBO. However, few queries are slow against CBO. This is a big database with 180 GB and it works over 2 years. Can someone share your experience on this?&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;Eric</description>
      <pubDate>Tue, 07 Sep 2004 03:18:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/execution-plan-on-cbo-vs-rule/m-p/3373224#M863908</guid>
      <dc:creator>ericfjchen</dc:creator>
      <dc:date>2004-09-07T03:18:19Z</dc:date>
    </item>
    <item>
      <title>Re: Execution Plan on CBO vs Rule</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/execution-plan-on-cbo-vs-rule/m-p/3373225#M863909</link>
      <description>Eric,&lt;BR /&gt;&lt;BR /&gt;Sometimes the CBO method is not the best !&lt;BR /&gt;Saying that ususally it's better than the old RBO (desupported after 9i ?)&lt;BR /&gt;&lt;BR /&gt;I some case we have to change oracle behaviour either by changeing init.ora parameters or adding SQL hints in the code or changing the way the data is loaded into a table (Physical parameters). It's all about tuning !&lt;BR /&gt;CBO makes your life easier but it 's not the ultimate performance master !&lt;BR /&gt;This means that DBA have still some work to do.&lt;BR /&gt;&lt;BR /&gt;see attachment&lt;BR /&gt;&lt;BR /&gt;Could you tell us how you update the statistics ?&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Jean-Luc</description>
      <pubDate>Tue, 07 Sep 2004 03:29:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/execution-plan-on-cbo-vs-rule/m-p/3373225#M863909</guid>
      <dc:creator>Jean-Luc Oudart</dc:creator>
      <dc:date>2004-09-07T03:29:05Z</dc:date>
    </item>
    <item>
      <title>Re: Execution Plan on CBO vs Rule</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/execution-plan-on-cbo-vs-rule/m-p/3373226#M863910</link>
      <description>Sorry&lt;BR /&gt;&lt;BR /&gt;forget the attachment&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Jean-Luc</description>
      <pubDate>Tue, 07 Sep 2004 03:30:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/execution-plan-on-cbo-vs-rule/m-p/3373226#M863910</guid>
      <dc:creator>Jean-Luc Oudart</dc:creator>
      <dc:date>2004-09-07T03:30:25Z</dc:date>
    </item>
    <item>
      <title>Re: Execution Plan on CBO vs Rule</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/execution-plan-on-cbo-vs-rule/m-p/3373227#M863911</link>
      <description>this document too&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;Jean-Luc&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 07 Sep 2004 03:31:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/execution-plan-on-cbo-vs-rule/m-p/3373227#M863911</guid>
      <dc:creator>Jean-Luc Oudart</dc:creator>
      <dc:date>2004-09-07T03:31:06Z</dc:date>
    </item>
    <item>
      <title>Re: Execution Plan on CBO vs Rule</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/execution-plan-on-cbo-vs-rule/m-p/3373228#M863912</link>
      <description>In my DB I use Rule and only Rule and I have no query taking more than 5 minutes! Ok, it's just a 17 GB database but it started with 12 GB and there is no difference on the performance. &lt;BR /&gt;&lt;BR /&gt;On init&lt;SID&gt;.ora have you setted the following parameters?&lt;BR /&gt;&lt;BR /&gt;timed_statistics = true &lt;BR /&gt;optimizer_mode = cost &lt;BR /&gt;&lt;/SID&gt;</description>
      <pubDate>Tue, 07 Sep 2004 03:38:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/execution-plan-on-cbo-vs-rule/m-p/3373228#M863912</guid>
      <dc:creator>Eric Antunes</dc:creator>
      <dc:date>2004-09-07T03:38:32Z</dc:date>
    </item>
    <item>
      <title>Re: Execution Plan on CBO vs Rule</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/execution-plan-on-cbo-vs-rule/m-p/3373229#M863913</link>
      <description>CBO is better in most case. It aims at finding the execution plan for a query. But sometimes it has no success. It's rare and becoming more rare every version.&lt;BR /&gt;&lt;BR /&gt;You have many solutions to correct such a problem : &lt;BR /&gt;Modify the query&lt;BR /&gt;Add hints&lt;BR /&gt;Open a TAR&lt;BR /&gt;&lt;BR /&gt;As long as the two first may be unsufficent (or can not be done), you may have to contact Oracle support. Note that this third solution may be long.&lt;BR /&gt;&lt;BR /&gt;Apparently you can modify queries so you can do it before using this hint.&lt;BR /&gt;&lt;BR /&gt;Note that RBO will effectivly be desupported after 9i, and may really disappear in future releases.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Fred&lt;BR /&gt;</description>
      <pubDate>Tue, 07 Sep 2004 03:39:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/execution-plan-on-cbo-vs-rule/m-p/3373229#M863913</guid>
      <dc:creator>Fred Ruffet</dc:creator>
      <dc:date>2004-09-07T03:39:31Z</dc:date>
    </item>
    <item>
      <title>Re: Execution Plan on CBO vs Rule</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/execution-plan-on-cbo-vs-rule/m-p/3373230#M863914</link>
      <description>Hi Eric,&lt;BR /&gt;&lt;BR /&gt;You have just assigned points to 8 of 46 responses... :-( &lt;BR /&gt;&lt;BR /&gt;We need points to survive. :-)</description>
      <pubDate>Tue, 07 Sep 2004 06:31:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/execution-plan-on-cbo-vs-rule/m-p/3373230#M863914</guid>
      <dc:creator>Eric Antunes</dc:creator>
      <dc:date>2004-09-07T06:31:38Z</dc:date>
    </item>
    <item>
      <title>Re: Execution Plan on CBO vs Rule</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/execution-plan-on-cbo-vs-rule/m-p/3373231#M863915</link>
      <description>Eric,&lt;BR /&gt;&lt;BR /&gt;You might also want to look at Histograms.  I have heard that they work well, however I have not had the available time to look into them more.  &lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;Brian</description>
      <pubDate>Mon, 16 Sep 2024 09:08:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/execution-plan-on-cbo-vs-rule/m-p/3373231#M863915</guid>
      <dc:creator>Brian Crabtree</dc:creator>
      <dc:date>2024-09-16T09:08:34Z</dc:date>
    </item>
    <item>
      <title>Re: Execution Plan on CBO vs Rule</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/execution-plan-on-cbo-vs-rule/m-p/3373232#M863916</link>
      <description>Hmmm,&lt;BR /&gt;&lt;BR /&gt;having statistics on the table alone rarely has an effect on which index is chosen. &lt;BR /&gt;Do you run statistics on the indexes as well ?&lt;BR /&gt;&lt;BR /&gt;Let's see the script you use to analyze.&lt;BR /&gt;Do you log the result of the analyze ?&lt;BR /&gt;In case of a big DB, an analyze of a big table may fail (for rollback/undo or temp space requirements) resulting in no statistices being stored, although you started a job to collect them.&lt;BR /&gt;Check you analysis for errorcodes.&lt;BR /&gt;&lt;BR /&gt;Hope this helps&lt;BR /&gt;Volker&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 07 Sep 2004 12:20:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/execution-plan-on-cbo-vs-rule/m-p/3373232#M863916</guid>
      <dc:creator>Volker Borowski</dc:creator>
      <dc:date>2004-09-07T12:20:48Z</dc:date>
    </item>
    <item>
      <title>Re: Execution Plan on CBO vs Rule</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/execution-plan-on-cbo-vs-rule/m-p/3373233#M863917</link>
      <description>Hi All,&lt;BR /&gt;&lt;BR /&gt;The analyze method we did is "exec dbms_stats.gather_schema_stats (  ownname =&amp;gt; 'SCOTT',  estimate_percent =&amp;gt; 99,  options =&amp;gt; 'GATHER', granularity =&amp;gt; 'ALL',  cascade =&amp;gt; TRUE); ".&lt;BR /&gt;We do that for all schemas every week. The result is successful.  Therefore, we believe the statistics for all objects are correct against CBO. However, some queries need to addon hint. Have any idea?&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;Eric</description>
      <pubDate>Thu, 09 Sep 2004 22:53:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/execution-plan-on-cbo-vs-rule/m-p/3373233#M863917</guid>
      <dc:creator>ericfjchen</dc:creator>
      <dc:date>2004-09-09T22:53:31Z</dc:date>
    </item>
    <item>
      <title>Re: Execution Plan on CBO vs Rule</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/execution-plan-on-cbo-vs-rule/m-p/3373234#M863918</link>
      <description>Hi Eric,&lt;BR /&gt;&lt;BR /&gt;The CBO determines the best plan by calculating an estimated COST for various execution plans and uses the plan with the lowest cost. To give CBO the most information (and the best chance of choosing a good execution plan) you should ANALYZE all tables to be queried. CBO works well for ad-hoc queries.  For hard coded, repeated SQL statements, these should be tuned to obtain a repeatable optimal plan. &lt;BR /&gt;&lt;BR /&gt;Any hint, except RULE, causes CBO to be used. It is very important to note that a HINT cannot be 'turned off' by any parameter settings.  &lt;BR /&gt;&lt;BR /&gt;As the optimzer evaulates the cost of each plan it compares it with the best cost plan seen so far. It keeps doing that until it gets to the best from the range of plans it considers. If the best plan selected is not the "ideal" plan based on the users knowledge of the data, the user can force a different plan by using "Hints". &lt;BR /&gt;&lt;BR /&gt;In summary to make effective use of the CBO you should: &lt;BR /&gt; &lt;BR /&gt; - Analyze all tables regularly. &lt;BR /&gt; &lt;BR /&gt; - Set the required OPTIMIZER_GOAL (FIRST_ROWS or ALL_ROWS). &lt;BR /&gt; &lt;BR /&gt; - Use hints to help direct the CBO where required. &lt;BR /&gt; &lt;BR /&gt; - Use hints in PL/SQL to ensure the expected optimizer is used. &lt;BR /&gt; &lt;BR /&gt; - Be careful with the use of bind variables. &lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Indira A&lt;BR /&gt;</description>
      <pubDate>Thu, 09 Sep 2004 23:43:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/execution-plan-on-cbo-vs-rule/m-p/3373234#M863918</guid>
      <dc:creator>Indira Aramandla</dc:creator>
      <dc:date>2004-09-09T23:43:26Z</dc:date>
    </item>
    <item>
      <title>Re: Execution Plan on CBO vs Rule</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/execution-plan-on-cbo-vs-rule/m-p/3373235#M863919</link>
      <description>We had a similar problem with 9i release 1. The cbo was working well with 90% of the queries, but it was screwing up with the rest 10% queries. Oracle could not explain this, ans instead recommended me to move to 9i release 2. To be honest it works. We only have 0.2% runaway queries. Also as it was a data warehouse, setting optimizer goal to ALL_ROWS helped. Try computing stats for the tables instead of estimating, and in 3 occations I saw huge difference in execution plans. We are on 9.2.0.5, and it runs great.&lt;BR /&gt;Mitra</description>
      <pubDate>Sat, 11 Sep 2004 18:26:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/execution-plan-on-cbo-vs-rule/m-p/3373235#M863919</guid>
      <dc:creator>Aniruddha Mitra</dc:creator>
      <dc:date>2004-09-11T18:26:24Z</dc:date>
    </item>
  </channel>
</rss>

