How to use Cost Based Optimizer

Hi,
I'm looking for a documentation about CBO, I found some information through google and here but anyone knows where I can found more informaton about CBO, how to use, how i'ts increase the performance and more?
Thank You

See Oracle® Database Performance Tuning Guide

Similar Messages

  • How can I know the database is using Cost Based or Rule Based?

    Hi all expertise,
    How can I know the database is using Cost Based or Rule Based?
    If cost based it is using, what methods are need to use to minimize the cost when database is running? And which tables I can see the performance of the database?
    Thanks
    Amy

    how to see database setting ?
    use this
    SQL> sho parameter optimizer
    NAME TYPE VALUE
    optimizer_dynamic_sampling integer 1
    optimizer_features_enable string 9.2.0
    optimizer_index_caching integer 0
    optimizer_index_cost_adj integer 100
    optimizer_max_permutations integer 2000
    optimizer_mode string CHOOSE
    choose means if table statistics is available then it will use cost
    else
    use rule based optimizer
    for seeing performnace of table use
    set autotrace on
    and run your query
    if it doen't show cost.it means it use rule based
    for using cost based
    u will calculate table statistics
    9i
    dbms_stats.gather_table_stats('owner','table');
    8i
    analyze table <table_name> compute statistics;
    hope it will help you
    kuljeet pal singh

  • Top Link Special Considerations in moving to Cost Based Optimizer....

    Our current application architecture consists of running a Java based application with Oracle 9i as the database and toplink as the object relational mapping tool. This is a hosted application about 5 years old with stringent SLA requirements and high availability needs. We are currently using Rule Based Optimizer (RBO) mode and do not collect statistics for the schemas. We are planning a move to Cost Based Optimizer (CBO)
    What are the special considerations we need to be aware of from moving RBO to CBO from top link perspective. Is top link code optimized for one mode over the other ?. What special parameter settings are needed ?. Any of your experience in moving Top Link based applications to RBO and best practices will be very much appreciated.
    -Thanks
    Ganesan Maha

    Ganesan,
    Over the 10 years we have been delivering TopLink I do not recall any issues with customizing TopLink for either approach. You do have the ability to customize how the SQL is generated and even replace the generated SQL with custom queries should you need to. This will not require application changes but simply modifications to the TopLink metadata.
    As of 9.0.4 you can also provide hints in the TopLink query and expression framework that will be generated into the SQL to assist the optimizer.
    Doug

  • Rule based & Cost based optimizer

    Hi,
    What is the difference Rule based & Cost based optimizer ?
    Thanks

    Without an optimizer, all SQL statements would simply do block-by-block, row-by-row table scans and table updates.
    The optimizer attempts to find a faster way of accessing rows by looking at alternatives, such as indexes.
    Joins add a level of complexity - the simplest join is "take an appropriate row in the first table, scan the second table for a match". However, deciding which is the first (or driving) table is also an optimization decision.
    As technology improves a lot of different techiques for accessing the rows or joining that tables have been devised, each with it's own optimium data-size:performance:cost curve.
    Rule-Based Optimizer:
    The optimization process follows specific defined rules, and will always follow those rules. The rules are easily documented and cover things like 'when are indexes used', 'which table is the first to be used in a join' and so on. A number of the rules are based on the form of the SQL statement, such as order of table names in the FROM clause.
    In the hands of an expert Oracle SQL tuner, the RBO is a wonderful tool - except that it does not support such advanced as query rewrite and bitmap indexes. In the hands of the typical developer, the RBO is a surefire recipie for slow SQL.
    Cost-Based Optimizer:
    The optimization process internally sets up multiple execution proposals and extrapolates the cost of each proposal using statistics and knowledge of the disk, CPU and memory usage of each of the propsals. It is not unusual for the optimizer to analyze hundred, or even thousands, of proposals - remember, something as simple as a different order of table names is a proposal. The proposal with the least cost is generally selected to be executed.
    The CBO requires accurate statistics to make reasonable decisions.
    Even with good statistics, the complexity of the SQL statement may cause the CBO to make a wrong decision, or ignore a specific proposal. To compensate for this, the developer may provide 'hints' or recommendations to the optimizer. (See the 10g SQL Reference manual for a list of hints.)
    The CBO has been constantly improving with every release since it's inception in Oracle 7.0.12, but early missteps have given it a bad reputation. Even in Oracle8i and 9i Release 1, there were countless 'opportunities for improvement' <tm> As of Oracle 10g, the CBO is quite decent - sufficiently so that the RBO has been officially deprecated.

  • Cost Based Optimizer (CBO)

    not sure if this is a daft question or what. but i am trying to find out where exactly it exists.
    i know, when performing ST05 and viewing the execution plan, we see what the CBO has used, but is the CBO purely performed at the database server, and not at the SAP Application.
    When updating the statistics, are these passed to the database server, and once again, the CBO utilizes them for the execution plan, or do the database statistics actually reside in the database server.
    finally, in viewing the execution plan, the statement "execution costs = xxx" (xxx being a numeric value). what exactly is xxx. maybe an internal index used to compare  execution plans, or maybe the number of blocks required to read the "estimated #rows".
    anyone  ??
    thanks
    glen

    Hello Glen,
    So far as my knowledge is concerned, the statistics are actually located on the database server. That is what appears to be more logical too. what is the use of maintaining the access paths on tha application server ? Most of the modern database servers are equipped with the CBO functionality. And Cost-Based-Optimizing is dependent on the database.
    Here's what the documentation says:
    <i>You can update statistics on the Oracle database using the Computing Center Management System (CCMS). The transactions to be used are DB20 and DB21.
    By running update statistics regularly, you make sure that the database statistics are up-to-date, so improving database performance. The Oracle cost-based optimizer (CBO) uses the statistics to optimize access paths when retrieving data for queries. If the statistics are out-of-date, the CBO might generate inappropriate access paths (such as using the wrong index), resulting in poor performance.
    From Release 4.0, the CBO is a standard part of the SAP System. If statistics are available for a table, the database system uses the cost-based optimizer. Otherwise, it uses the rule-based optimizer.</i>
    Regards,
    Anand Mandalika.

  • How to use cost center hierarchy?

    Hi,
                  How to use cost center hierarchy?I have created that but how to use that.Can somebody help me?
                                        Sekar

    Once the Cost Centre Hierarchy is Created, it can be used in Profit Centre Reports.
    Choose Financials -> Cost Accounting -> Profit Center Report ->Template.
    Here Choose, the Cost Centre Hierarchy the you had created and generate the report.
    Also refer these threads
    [Reg... Costcenter hierarchy;
    [cost centre hierarchy;

  • How to use ICC based colorspace

    hello,
    The question is how to define a color in ICC based colorspace ?
    I tried with gState.strokeColorSpec.value.color array and it work fine when my CIE based colorspace is CMYK but how to do it when colorspace can be CMYKOG or RGB ... ?
    Regards,
    William

    You can certainly use Cos to create the ICC colorspace (or the alternate) just as you did for the DeviceN.
    Cos is just a wrapper over direct PDF objects – so read the PDF standard for what the objects you need are, then make the relevant calls.
    From: Adobe Forums <[email protected]<mailto:[email protected]>>
    Reply-To: "[email protected]<mailto:[email protected]>" <[email protected]<mailto:[email protected]>>
    Date: Thu, 20 Oct 2011 03:03:46 -0700
    To: Leonard Rosenthol <[email protected]<mailto:[email protected]>>
    Subject: how to use ICC based colorspace
    Re: how to use ICC based colorspace
    created by yokuju<http://forums.adobe.com/people/yokuju> in Acrobat SDK - View the full discussion<http://forums.adobe.com/message/3981410#3981410

  • How to Use Cost Depreciation 20 in assets

    Hi,
    All could you please tell possible ways to use Cost depreciation
    After that
    the below points i am expecting
    1  We need to recognize both type(costed depreciation) of  depreciation.
    2  Only costed depreciation we need to recognize reversal entry that sample is as follows.
    3   eg    Recognize DR  Costed depreciation   CR  Accumulated costed depreciation
          ( If you need new GL account you can register on 600 environment.)
    4   eg    Reversal   DR  Accumulated depreciation   CR    Reversal costed depreciation
           ( If you need new GL account you can register on 600 environment.)
    5   Conclusion  Based on above 3 and 4, our P/L impact is zero.
    6   Above 3 and 4 transaction recognize is not by manual.
    Could you please suggest the above example how to do in SAP

    You just need to create a new depreciation area for cost deprecition and do specific config as per your requirement.
    Tarun

  • How to use text based index

    Hi,
    I want to use a text based index. The problem statement was i have to delete all those records which have column
    'ABC%'
    means data can be ABC1, ABC2, ABCl, ABCn
    so i thought i would do like
    delete from tab1
    where col1 like 'ABC%'.
    There are millions of records.
    so i thought of optimizing the Query by using text based index. If my approach is right can you suggest how i can implement it and Is there any other way around?
    Thanks
    _vinod                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Are you saying that simple b tree index would be used in a qurey where i have used LIKE operator? Yes. Not "would" but certainly "could", as long as wildcard is trailing.
    Now whether it "would" depends on whether it's estimated to be the cheapest access path.

  • Rule based optimizer vs Cost based optimizer - 9i

    Is Rule based optimizer not used any more or can be used depending on the application etc.
    I think Rule based optimizer still has some advantages. Please give your input if you think otherwise.
    Thx

    I think Rule based optimizer still has some
    advantages. Please give your input if you think
    otherwise.You are absolutely correct. There are a few advantages to RBO.
    RBO is better for any application that meets the following criteria:
    - designed for Oracle version 7;
    - has not been updated since Oracle 7;
    - was hand tuned in Oracle 7;
    - will not be upgraded to Oracle Database 10g (where RBO is obsolete);
    - will not use Bitmap Indexes, Materialized Views, Query Rewrite, or vitrtually anything that was introduced in Oracle8 and beyond.
    CBO, while not perfect, will allow new features to be used. And it is improving with every release.

  • How to use JKS-based Keystore in Oracle SOA 11g

    I am trying to do FTPS on third party remote server(with UNIX OS) using SOA 11g FTP Adapter. I have Installed and Configured vsftpd and generated vsftpd.pem certificate file on remote server.
    Followed the steps mentioned in http://download.oracle.com/docs/cd/E17904_01/integration.1111/e10231/adptr_file.htm#CIABDGCF
    In one of the step "Setting Up the Oracle FTP Adapter" walletLocation is required, then I went through steps mentioned in http://download.oracle.com/docs/cd/E17904_01/core.1111/e10105/wallets.htm#CHDGIJDC
    Tried to use both 1) JKS Keystore Management 2) Wallet Management
    But unable to find both of them in em of Oracle SOA 11g as the steps are not matching.
    Can anyone tell me how to use JKS Keystore Management or Wallet Management ?
    Many Thanks!!
    Regards
    Yogesh

    Hi Yogesh,
    I believe the wallet can be created from the FMW console only if the HTTP server is installed and available. If there is no Oracle HTTP server, please configure one as given under.
    [ http://download.oracle.com/docs/cd/E12839_01/doc.1111/e14260/toc.htm | Oracle HTTP Server Installation ]
    Reards,
    Neeraj Sehgal

  • How to use duplicate() to optimize in M3G?

    The first version of my 3D world contains about 7 meshes. They all have the same form and geometry, so I figured I could use duplicate() to improve the performance. I mean creating only one mesh and then use duplicate() on that first mesh to create the other ones. The 7 meshes have different textures, so they need to have their own appearances.
    I found that it is not possible to use duplicate() to optimize in my case , since the meshes have their own appearance object. When I change the appearance of one mesh, the appearance of the duplicated meshes get changed too. Is there any way to solve this problem?

    Hi Sandy ,
    You can approach this way ,
    Create a page with different EO , VO
    Step 1 : If the records are displayed in table region then you can add one more column with the item style as " Link " .
    ( your desintaion URI should be OA.jsp?page=/<yourname>/oracle/apps/ak/employee/webui/EmpDetailsPG&employeeNumber={@EmployeeId} )
    Step 2 : You can get the same record in the next screen by executing the query by passing the parameter in where clause .
    In processRequest , order of code execution should be
    a ) Create a blank row for VO
    b) generate new Sequence value and execute the query by passing the parameter in where clause
    In processFormRequest ()
    Make changes if needed and do Transaction.commit() ;
    Though it looks like an updating record , but in database you will find an additional record being created .
    Try and do let me know if its not clear
    Keerthi

  • How to avoid full Table scan when using Rule based optimizer (Oracle817)

    1. We have a Oracle 8.1.7 DB, and the optimizer_mode is set to "RULE"
    2. There are three indexes on table cm_contract_supply, which is a large table having 28732830 Rows, and average row length 149 Bytes
    COLUMN_NAME INDEX_NAME
    PROGRESS_RECID XAK11CM_CONTRACT_SUPPLY
    COMPANY_CODE XIE1CM_CONTRACT_SUPPLY
    CONTRACT_NUMBER XIE1CM_CONTRACT_SUPPLY
    COUNTRY_CODE XIE1CM_CONTRACT_SUPPLY
    SUPPLY_TYPE_CODE XIE1CM_CONTRACT_SUPPLY
    VERSION_NUMBER XIE1CM_CONTRACT_SUPPLY
    CAMPAIGN_CODE XIF1290CM_CONTRACT_SUPPLY
    COMPANY_CODE XIF1290CM_CONTRACT_SUPPLY
    COUNTRY_CODE XIF1290CM_CONTRACT_SUPPLY
    SUPPLIER_BP_ID XIF801CONTRACT_SUPPLY
    COMMISSION_LETTER_CODE XIF803CONTRACT_SUPPLY
    COMPANY_CODE XIF803CONTRACT_SUPPLY
    COUNTRY_CODE XIF803CONTRACT_SUPPLY
    COMPANY_CODE XPKCM_CONTRACT_SUPPLY
    CONTRACT_NUMBER XPKCM_CONTRACT_SUPPLY
    COUNTRY_CODE XPKCM_CONTRACT_SUPPLY
    SUPPLY_SEQUENCE_NUMBER XPKCM_CONTRACT_SUPPLY
    VERSION_NUMBER XPKCM_CONTRACT_SUPPLY
    3. We are querying the table for a particular contract_number and version_number. We want to avoid full table scan.
    SELECT /*+ INDEX(XAK11CM_CONTRACT_SUPPLY) */
    rowid, pms.cm_contract_supply.*
    FROM pms.cm_contract_supply
    WHERE
    contract_number = '0000000000131710'
    AND version_number = 3;
    However despite of giving hint, query results are fetched after full table scan.
    Execution Plan
    0 SELECT STATEMENT Optimizer=RULE (Cost=1182 Card=1 Bytes=742)
    1 0 TABLE ACCESS (FULL) OF 'CM_CONTRACT_SUPPLY' (Cost=1182 Card=1 Bytes=742)
    4. I have tried giving
    SELECT /*+ FIRST_ROWS + INDEX(XAK11CM_CONTRACT_SUPPLY) */
    rowid, pms.cm_contract_supply.*
    FROM pms.cm_contract_supply
    WHERE
    contract_number = '0000000000131710'
    AND version_number = 3;
    and
    SELECT /*+ CHOOSE + INDEX(XAK11CM_CONTRACT_SUPPLY) */
    rowid, pms.cm_contract_supply.*
    FROM pms.cm_contract_supply
    WHERE
    contract_number = '0000000000131710'
    AND version_number = 3;
    But it does not work.
    Is there some way without changing optimizer mode and without creating an additional index, we can use the index instead of full table scan?

    David,
    Here is my test on a Oracle 10g database.
    SQL> create table mytable as select * from all_tables;
    Table created.
    SQL> set autot traceonly
    SQL> alter session set optimizer_mode = choose;
    Session altered.
    SQL> select count(*) from mytable;
    Execution Plan
       0      SELECT STATEMENT Optimizer=CHOOSE
       1    0   SORT (AGGREGATE)
       2    1     TABLE ACCESS (FULL) OF 'MYTABLE' (TABLE)
    Statistics
              1  recursive calls
              0  db block gets
             29  consistent gets
              0  physical reads
              0  redo size
            223  bytes sent via SQL*Net to client
            276  bytes received via SQL*Net from client
              2  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
              1  rows processed
    SQL> analyze table mytable compute statistics;
    Table analyzed.
    SQL>  select count(*) from mytable
      2  ;
    Execution Plan
       0      SELECT STATEMENT Optimizer=CHOOSE (Cost=11 Card=1)
       1    0   SORT (AGGREGATE)
       2    1     TABLE ACCESS (FULL) OF 'MYTABLE' (TABLE) (Cost=11 Card=1
              788)
    Statistics
              1  recursive calls
              0  db block gets
             29  consistent gets
              0  physical reads
              0  redo size
            222  bytes sent via SQL*Net to client
            276  bytes received via SQL*Net from client
              2  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
              1  rows processed
    SQL> disconnect
    Disconnected from Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - 64bit Production
    With the Partitioning, Oracle Label Security, OLAP and Data Mining options

  • How to use Endeca Url Optimization API

    Hi All,
    Iam working to implement Endeca Url Optimization API to a java project developed in RAD.
    Any one please guide me to achieve the same.
    Issue:
    Iam calling parseRequest(String Querystring,String pathinfo,string encoder) method to get encoded N-vaue value
    For the case of multiple filter selection, Iam passing pathinfo as “/cat_CL167288/_/N-1z139r3” where N-1z139r3 is the encoded N-value of previously selected filter.
    UrlState baseUrlState=seoFormatter.parseRequest("catalogId=10020&storeId=50001&langId=1&N=1z139r3","/cat_CL167288/_/N-1z139r3","UTF-8");
    We are getting an error which is thrown from SEOURL API jars. I have decompiled the jar and found that the exception is throwing while setting N Param value, but able to set other values without exception.
    paramUrlState.setParam(“N”, “1z139r3”);
    Here is the error message :
    java.lang.IllegalStateException: UrlState doesn't contain valid navigation state: you must explicitly call UrlState.inform(ENEQueryResults) or UrlState.setNavState(...) before handling the navigation state of an UrlState
    at com.endeca.soleng.urlformatter.UrlState.getNavStateUrlParam(Unknown Source)
    Please help me
    thanks,
    RGL

    Hi Roy,
    > I found this line:
    Within the docu or within your page?
    Normally, when it's within the page, you don't have to add it to your iView. It has to be on the page.
    There must be somethin else strange. Maybe an error in NW implementation, but I would think that's probably some minor mistake on your site.
    Please minimize your example as far as you can: Use a JSPDynpage with nothing in it than the redirect to the JSP, within the JSP, do nothing in it than the things needed for the call of the pageSupport object, and a corresponding minimized portalapp.xml.
    Post them here in the thread (using code marker).
    And give additional info how the iView when you tested and still it didn't work has been isolated (URL/embedded). Also try to play with these settings by yourself.
    Hope it helps
    Detlev

  • How to use Edition Based Redefinition in APEX?

    Hello,
    This might be my first question on this forum ;-)
    I am trying to get 11gR2 Edition Based Redefinition to work within APEX. But for testing purposes (before altering the database to use the new edition as the default) I have to set the edition at the session level. But as APEX shares sessions from the pool (I might get another session with every page refresh/call), I need to execute an ALTER SESSION command.
    I can't use EXECUTE IMMEDIATE, 'cause that results in:
    execute immediate 'alter session set edition=HR_RELEASE2';
    ORA-38815 : ALTER SESSION SET EDITION must be a top-level SQL statement
    So is there a way to just run a SQL command at the "start" of a page (request)?
    Greetings,
    Roel
    http://roelhartman.blogspot.com/
    Edited by: Roel on Feb 28, 2010 7:00 PM
    - Changed the subject of this post (for an easier search on the forum)

    Hello all,
    Patrick and John were on the right track...
    After contacting Bryn (the Oracle brain behind EBR), there appeared to be a DAD attribute called 'database-edition'. Using this you can change the Edition of a DAD (and via the DAD ... all the users that use that DAD):
    begin
    dbms_epg.set_dad_attribute('APEX', 'database-edition', 'HR_RELEASE2');
    end;The funny thing is that a user doesn't have to re-connect. With the next server roundtrip he will use the other edition!
    Remarkable fact: This setting doesn't effect the Session-Edition, but only the Current-Edition. Have to test how that'll work out when using CrossEdition Triggers...
    Another thing: There seems to be an equivalent for the Apache /HTTP Server.
    You have to add a line to your dads.conf setting for PlsqlDatabaseEdition.
    If I add that line (in my environment) the HTTP Server fails to start with:
    /home/oracle/OraHome_1/Apache/Apache/bin/apachectl start: execing httpd
    Syntax error on line 48 of /home/oracle/OraHome_1/Apache/modplsql/conf/dads.conf:
    Invalid command 'PlsqlDatabaseEdition', perhaps mis-spelled or defined by a module not included in the server configurationApart from that: You have to restart the HTTP Server to use the changed DAD. So that is in opposite of the whole goal of EBR (24 x 7 availability).
    Once I figured it all out I'll write a blog post about it. If somebody has anything to add to this thread, feel free! Especially the HTTP Server/Edition combination would be interesting!
    Greetings,
    Roel
    http://roelhartman.blogspot.com/

Maybe you are looking for

  • Pass parameter to Bex Query via Query String

    Hello, I am trying to pass a parameter into a Bex Query from a 7.0 portal. I created a Bex query iView and I have tried various permutations with the Bex Query String property of the iview but nothing seems to work. The query runs but the parameter i

  • Safari consuming 80% + CPU

    On our PowerBook G4 - we've noticed that Safari seems to be consuming more and more CPU lately. Restarting Safari if it's been running for more than a few days, or even rebooting the PowerBook helped in the past when we had this issue, but not anymor

  • Web Intelligence Rich Client

    HI guys, I am new to BO...just wanted to know that is there any place I can download web intelligence rich client which can work as standlone for trial period.Just want to get the feel of what this application is all about?

  • Itunes hangs when I try importing a CD. I'm running OS X Mavericks. I've never had this problem before. Any tips?

    I'm trying to import a CD onto my MBP from a superdrive for one of my college classes. However, I am unable to because it will only import two tracks and then hangs on the thrid one. After a minute or so, Itunes becomes unresponsive. I have never enc

  • Trying to Export my 1-1/2 hour project to iDVD

    Lost the first attempt to create this one, forty hours..files accidentally lost, now all rebuilt and don't want to mess it up this time. Will appreciate your help very much. I tried to export..chose Quicktime Movie...and having a few chapter markers,