HINTS with CBO Optimizer?

Hi Experts,
First of all Merry Chrismas to all ...
I am confusing in the area of HInts.. My question in that are we using any Hints when Optimizer is  CBO ?( i am using oracle 10g r2)
bcoz some dba of my project are saying dont ever user Hints if optimizer is CBO. It will Handle the query and will give you most efficient execution plan.
can you please guide me about this?  and my another question is that if I am writting a select statement and it involve the join of 7 tables(assume)
then is it necessary to have the proper order of table and where clause if i am using CBO optimizer?
Thanks in advance,
Prashant

1. Your DBA is right. Using Optimizer hints is the path of last resort.
See: Ask Tom "Hints When to use"
2. No need to worry about the order of tables, CBO is smart enough to figure that out.
Suggest you read more about it here:
https://blogs.oracle.com/optimizer/
Hinting | Oracle Scratchpad

Similar Messages

  • CBO (optimizer) nest-loop join question

    OS: Red Hat Linux
    DB: 11gR1
    I have gotten two conflicting answers while reading books by Don Burleson and Dan Hotka. It has to do with the CBO and nested-joins:
    One says the CBO will choose the 'smaller' table as the driving table, the other states that the 'larger' table will be the driving table. And both stick by this philosophy as the preferred goal of any SQL Tuning -- that is, one states that the 'smaller' table should be the driving table. The other says the 'larger' table should be the driving table.
    I had always thought that the 'smaller' table should be the driving table. That in a nested loop the driving will not likely use an index even. Who is correct? (I am not going to say who said what, btw). :-)
    But I got to let one of them know they got a 'typo' ... :-)
    Thx.

    user601798 wrote:
    It is an over-simplistic scenario but, as I mentioned, if all other things are 'equal' -- which would include 'access time/work', then I think the small table as the driving table has the advantage.
    It is not possible for +"*all* other things to be equal"+. (my emphasis).
    If by +'access time/work'+ you mean the total is the same then it doesn't matter which table is first, the time/work is the same either way round.
    If you want to say that the +'access time/work'+ for acquiring the first rowsource is the same for both paths, and the +'access time/work'+ for acquiring related rows from the second table is the same FOR EACH DRIVING ROW, then the total +'access time/work'+ will be difference, and it would be better to start with the smaller table. (The example by Salman Qureshi above: Re: CBO (optimizer) nest-loop join question would apply.)
    On the other hand, and ignoring any idea of "all other things being equal", smaller tables tend to have smaller indexes, so if your smaller rowsource comes from a smaller table then acquiring those rows may be cheaper than acquiring rows from a larger table - which leads to the observation that (even with perfectly precise indexing):
    <ul>
    smaller number of rows * larger unit cost to find related rows
    </ul>
    may produce a larger value than
    <ul>
    larger number of rows * smaller unit cost to find related rows
    </ul>
    Regards
    Jonathan Lewis
    http://jonathanlewis.wordpress.com
    http://www.jlcomp.demon.co.uk
    A general reminder about "Forum Etiquette / Reward Points": http://forums.oracle.com/forums/ann.jspa?annID=718
    If you never mark your questions as answered people will eventually decide that it's not worth trying to answer you because they will never know whether or not their answer has been of any use, or whether you even bothered to read it.
    It is also important to mark answers that you thought helpful - again it lets other people know that you appreciate their help, but it also acts as a pointer for other people when they are researching the same question, moreover it means that when you mark a bad or wrong answer as helpful someone may be prompted to tell you (and the rest of the forum) what's so bad or wrong about the answer you found helpful.

  • Problem with Maintenance Optimizer after first step

    Hi all,
    I have problem with Maintenance Optimizer after I choose system and save transaction, I click on Continue button, but nothing happens....
    Any ideas?
    Regards,
    Lazar Hristov

    I resolved my problem.
    I activate from spro -> Initial Configuration II, then activate BC Set for mopz and now everything works fine.
    Regards,
    Lazar Hristov

  • What are the tasks we can do with Maintenance Optimizer

    What are the tasks we can do with Maintenance Optimizer?

    Hi,
    All Corrective Packages for SAP NW04 , NW04s and SAP Business suite delivered after 04/02/2007 will only be available via SAP Solution Manager MOPZ
    Also it Reduces risk, Increase transparency and Prepared for Future.
    Thanks
    Vijay Kothapalli

  • Parallel query hint with stored outlines

    Hi,
    Can I use parallel query hint with stored outlines.
    Regards
    MMU

    I'm not quite sure what you're asking, since stored outlines themselves implement hints to try to maintain plan stability.
    If you're asking if stored outlines will utililze the parallel query hints I'd have to assume "yes" but would test the idea anyway.
    Message was edited by:
    riedelme

  • Can the CBO optimizer be slow ?

    Hi,
    i have a strange problem with a query. The first time i execute the query it takes 3 or 4 seconds to be executed. The query has a correct plan (i use the FIRST_ROWS hint) and the second time i execute it then the response is quite immediate.
    I have tried to use the RULE hint and the plan is the same as with the FIRST_ROWS hint, but the query is very fast the first time too. I've noted that the time the tkproof utility takes to obtain the query plan (with the FIRST_ROWS hint) is similar to the difference between the first and the second execution.
    My question is : can the CBO be so slow ?
    TIA
    Sergio Sette

    Neither one of those queries is using the CBO. /* RULE */ and /* FIRST ROWS */ are hints and use th Rules based optimizer.This is what the oracle documentation says :
    ---8<---
    FIRST_ROWS
    The optimizer uses a cost-based approach for all SQL statements in the session regardless of the presence of statistics and optimizes with a goal of best
    response time (minimum resource use to return the first row of the result set).
    --->8---
    first_rows (at least with 8.1.6 or later) uses the CBO and can be very slow. I have solved the problem reanalyzing (using the dbms_utility package) all the object in my schema.
    Regards
    sergio sette

  • Report and data comming wrong after compress data with full optimization

    In SAP BPC 5.1 version to increase the sysetm performance we did full optimization with compress data.
    Theis process end with error, after login into system the report and values comming wrong,
    What is the wrong,how to rectify it
    Regards
    prakash J

    This issue is resolved,

  • Error with Maintenance Optimizer in Solution Manager 4.0

    Hi, I am configuring Solution Manager for download SP, I check marketplace and download the guide, when I try to download a SP following message show me:
    "Change requests cannot be displayed or created, because the RFC connection has errors, or is not maintained.
    Check whether the RFC connection to the Change Man agement system is under the key CHARM_DEST (APPLI field in the DESTINAT field), in the view BCOS_CUST. You need authorization for the cross-client view/table maintenance (S_TABU_DIS and S_TABU_CLI).
    Check the RFC connection in the transaction SM59. If your SAP Solution Manager system is also your Change Manager system, the internal connection must be 'NONE'. You need authorization for the administration of RFC connections (S_RFC_ADM)."
    I go to sm59, verify RFC SAP-OSS with correct data, I found at guide following Host :
    /H/54.16.44.50/S/sapdp99/H/54.62.200.35/S/
    When I try press Connection Test Buttom I can not connect to SAP.
    Do you know which can be my error? .....
    Regards.

    Hi,
    Following the note 1024932
    Steps to do before configre the maintance optimizer you need to configure sattilite systems in solution manager.
    go to SMSY and configre R\3 systems.For these systems you need to create RFC connections and Logical comp.
    http://service.sap.com/rkt-solman
    for tutors and PDFs how to set up MOPZ.
    Points if it helpfull
    Regards
    Neni

  • White lines fixed with art optimization - Is it possible to copy with that setting?

    I've seen threads about the white lines you get on the edges of objects due to the anti-aliasing in Illustrator, and I found that when exporting, you can remove them by setting 'art optimized' in one of the options there.
    For those who don't know the white line issue:
    Sometimes, when Illustrator blends the pixels around an object, it puts a thin white line around it that always appears 1 px thick at any zoom level.
    It's not really there, and when printed it vanishes. Trouble is, even when exporting the document, or copying objects into other software for screen use, it's still there.
    A lot of people think the white line is a tiny gap, but it's not.
    People also tend to tell you it's because you have two objects butted up against one another. This is also not true. The white line still occurs even on overlapping shapes.
    People will also say it's when two shapes on top of each other follow the same path. Again, not true. The white lines still show up even when you only have 1 object following a particular path.
    My issue is that I rarely export an entire document at once, but tend to copy elements of it into Photoshop. When I do so, the white lines travel with it, and become permanent. Even on a .jpg, .png, or .gif image file, the lines are still visible.
    What I want to know is, can I copy objects from Illustrator using art optimization?
    Or is there any other way to copy them without taking those white lines with me?
    I know I can get rid of them by turning anti-aliasing off, but then everything looks really pixellated, so it's not much better.
    Plus, anti-aliasing doesn't actually fix the problem, it just hides it. Even with the setting off, when I copy affected objects to Photoshop, the white lines reappear in Photoshop.
    And please don't bother to reply explaining to me what the white lines are, or how to get rid of them, or how to lose them in exporting. I already know all that.
    Notes:
    I'm running Illustrator CS6
    And Photoshop CS6

    Weirdly, yes. That does work.
    The only problem is that I can't then resize it in Photoshop in the same way as a smart object. I'll just have to know what size it needs to be before I rasterize it.
    But for now, it's a solution that's workable. Thanks! ^.^

  • Use of the "updlock" hint with update and insert statements

    I have inherited some stored procedures and am trying to figure out why the developers decided to use the "updlock" hint on many of the update and insert statements. I have looked around everywhere and have found only one explanation of why "update...with
    (updlock)" can be useful, namely when a table has no clustered index:
    http://www.sqlnotes.info/2012/10/10/update-with-updlock/ I have found nothing yet that mentions why "insert into...with (updlock)" might be used. I understand why the hint
    might be useful on select statements in some cases, but if all of the tables have clustered indexes, is there any good reason to use it on update and insert statements?
    Thanks,
    Ron
    Ron Rice

    This form of deadlock error can occur on a table which has a clustered index.
    If you are doing updates on a table which has a clustered index and that table also has a nonclustered index and the nonclustered index is used to find the row to update you can see this type of deadlock.  For example create a table with a clustered
    primary key index and a nonclustered index by running
    Create Table Foo(PK int primary key identity, OtherKey varchar(10), OtherData int);
    go
    Insert Foo Default Values;
    go 10000
    Update Foo Set OtherKey = 'C' + Cast(PK As varchar(10))
    Create Unique Index FooIdx On Foo(OtherKey);
    That creates a table with 10000 rows, a clustered index and a nonclustered index.  Then run
    Begin Transaction
    Update Foo Set OtherData = 1 Where OtherKey = 'C5'
    That will use the FooIdx index to find the row that needs to be updated.  It will get a U lock on the index row in the FooIdx index, then an X lock on the row in the clustered index, update that row, then free the U lock on FooIdx, but keep the X lock
    on the row in the clustered index.  (There is other locking going on, but to simplify things, I'm only showing the locks that lead to the deadlock).
    Then in another window, run
    Begin Transaction
    Update Foo Set OtherData = 2 Where OtherKey = 'C5'
    This will get a U lock on the index row in the FooIdx index, then try to get an X lock on the row in the clustered index.  But that row is already exclusively locked, so this second window will wait holding a U lock on FooIdx row and is waiting for
    an X lock on the clustered index row.
    Now go back to the first window and run
    Update Foo Set OtherData = 3 Where OtherKey = 'C5'
    This will once again try to get the U lock on the FooIdx row, but it is blocked by the U lock the second window holds.  Of course the second window is blocked by the X lock on the clustered index row and you have a deadlock.
    All that said, I certainly do not routinely code my updates with UPDLOCK.  I try to design databases and write code so that deadlocks will be rare without holding excessive locks.  The more locks you hold and the longer you hold them, the more
    blocking you will get and the slower your system will run.  So I write code that if a deadlock exception occurs, it is properly handled.  Then if too many deadlocks occur, that is the time to go back to the code to see what changes are needed to
    decrease the number of deadlocks (one way to do that may be to get locks earlier and/or hold them longer. 
    But I wouldn't worry much about this form of deadlock.  It is, in my experience, vary rare.  I don't recall ever seeing it in a production environment.
    Tom

  • How to set hint with SQL profile

    Hi,
    I need to put a leading hint into a sub-query
    How can I do that ?
    I tried:
    dbms_sqltune.import_sql_profile
    sql_text => 'select ...'
    profile => sqlprof_attr(XXXXX) => I don't know what to set for XXXXX
    name => my_sql_profile
    force_match => true)10.2.0.4
    Thanks for your help

    I need to put a leading hint into a sub-query It doesn't sound like a good idea.
    If you're going to hint - especially using plan stability features - then you need to hint fully otherwise you're asking for trouble.
    See http://jonathanlewis.wordpress.com/2011/06/08/how-to-hint-1/
    The "best" approach to this sort of generic question is to run the sql statement with the single leading hint (if that really is desirable) then extract the full set of hints from that execution (which will have a different sql id) and apply it to your original statement.
    If you have a look at COE_XFR_SQL_PROFILE.SQL in Oracle Support doc id 215187.1 then that will give you a good idea of how to do it.
    That script is not exactly what you want because it uses a sql profile to apply a previously generated plan for that specific sql taken out of AWR or the cursor cache, but the principle is the same.
    This is using SQL Profiles as they were not originally designed - which was vehicles for statistical adjustements - but using them like stored outlines (the latter deprecated in 11.1 onwards).
    SQL Profiles require the tuning pack.
    You have not mentioned version but depending on that, it might be that SQL Plan Baselines are the appropriate mechanism and you can achieve something similar to that mentioned above using dbms_spm.load_plans_from_cursor_cache:
    load_plans_from_cursor_cache 
    (sql_id           IN VARCHAR2,   <---------- the sql id of the manually hinted sql from which to copy the plan
    plan_hash_value  IN NUMBER := NULL,  <-------------- the plan in memory to copy
    sql_text         IN CLOB,  <-------------------- the sql text of the sql to apply the plan above to (get via a direct look up from v$sql or dba_hist_sqltext as necesary)
    fixed            IN VARCHAR2 := 'NO', 
    enabled          IN VARCHAR2 := 'YES') Whichever method you use, avoid any sort of solution involving a single hint directed at a subquery.
    Edited by: Dom Brooks on Nov 26, 2012 9:48 PM
    reworded

  • Help with downhill optimization

    Hi all,
    I am trying to solve this one equation with one unknown using optimization.  It's a non-linear equation and I was searching around for something that works like excel's solver.  The downhill optimization seems close to what I want to do, but it is not optimizing.  Would anyone mind looking at this code and try to determine what I'm doing wrong?
    FYI, I've checked the answer by putting 0.02 as the X in my function and it is giving the right value.  The function is set up to be like:  Calc(X) - Actual = 0.  The "=0" portion should be implied (maybe this is what is wrong?)
    Thanks,
    Matt
    Solved!
    Go to Solution.
    Attachments:
    Calc Mod.vi ‏13 KB
    Calc Function.vi ‏23 KB

    The problem seemed to be the initial value of your function and the type of your function. If you try to plot it, you will notice the discontinuity around 21.049 as shown below:
    If you start from the left (like 21) then the minimization function will only be able to converge. If you start on the right (like 22), then you will find the X = 21.049 as minimum.
    Here is the code for it:
    Hope this helps
    Barp - Control and Simulation Group - LabVIEW R&D - National Instruments

  • Code hinting with array of elements

    I am having an issue where I can get code hinting on the entire array, but not if a I specify an individual element.
    Example
    var dataFields = new Array();
    var allElems = document.getElementsByTagName("*");
    for (var i = 0; i < allElems.length ; i++) {
            if (allElems[i].className == "classNameofElementIWant") dataFields.push(allElems[i]);
    Above is what I use to get an array populated with a specific element I want to work with.
    I can then get code hinting on dataFields.
    but no code hinting on dataFields[1].
    Obviously this is because the array doesn't have any elements in it until run time after it runs the above code.
    My question:
    Is there a way to tell code hinting to display using an array without the [] subscript specified when it can see that an array has no elements?
    Thank you

    I am having an issue where I can get code hinting on the entire array, but not if a I specify an individual element.
    Example
    var dataFields = new Array();
    var allElems = document.getElementsByTagName("*");
    for (var i = 0; i < allElems.length ; i++) {
            if (allElems[i].className == "classNameofElementIWant") dataFields.push(allElems[i]);
    Above is what I use to get an array populated with a specific element I want to work with.
    I can then get code hinting on dataFields.
    but no code hinting on dataFields[1].
    Obviously this is because the array doesn't have any elements in it until run time after it runs the above code.
    My question:
    Is there a way to tell code hinting to display using an array without the [] subscript specified when it can see that an array has no elements?
    Thank you

  • CM21 Strategy Profile with Setup Optimization but consider the requirements

    Dear guru.
    A question about strategy profile in CM21
    The system Is able to execute an automatic dispatch that optimize the setup time of the production order but also consider the requirements date in order that the production orders dispatched can cover the requirements without delay ?
    Thanks In advance

    Dear ,
    The system Is able to execute an automatic dispatch that optimize the setup time of the production order but also consider the requirements date in order that the production orders dispatched can cover the requirements without delay ?
    To answer to your query I would rather say that any operation  under an work centre have Execution time =Set up time +Processing Time +Tear Down Time  and also Inter operation time -Que time , Wait Time , Move Time .
    Now when you dipatch the operation in CM21 , it cheks the available capacity on that date  and also compare with the total operation timimngs within schedule start and schedule finish date  and then dispach automatically if work centre is not overloaded otherwise it will pop up with a Scheduling Logg or else it will appear with an window that will show u Date , Work Centre , Operation , timie so that you can change according to WC load n availablity in alternate date .So In the strategy prfile if you click Display dates while dispatching u can obseve the same .
    Now total  production order schedule start and schedule finsihe date will be considered and it will automatically chage as per the WC availabli capaciy while automatic dispatch .But u need to SAVE that to observe the changes in CM21.
    Hope it is clear
    Regards
    JH
    Edited by: Jiaul Haque on Jun 17, 2010 3:58 PM

  • Code hinting with objects? how do they do it?

    Hello,
    I am working with Flex Builder and it has a nice code completion and code hint option in it.
    If i use the Tweener class you get code hinting of an object.
    Example  : Tweener.addTween( { x:100, time:1, transition: "easeOutQuad"} );
    Now within the brackets (object) you also get code hinting. I was wondering how to do this too?
    Do i need to make a new public object?
    public var myObj:Object = new Object();
    public var myObj.time = 4;
    public var myObj.xPos = 20;
    MyCustomClass.customFunction( { ..the myObj properties..   });
    Regards,
    Chris

    thanks for the reply! I did not know with the param options.
    That is very nice! And i understand now how it works. The only thing i was wondering is, that
    you can see what to enter with param for a function. But not within an object.
    For example the caurina tweener.
    Tweener.addTween( yourmovie, { x:100, there is no hinting or knowing what properties can be set here ..... } );
    function doSomething(argument1:Boolean = true,  myNumber:Number  = 24):void {
    doSomething( ..in here you get always code hinting because it are params,  { but not in an object ? } );
    Regards,
    Chris.

Maybe you are looking for