Is  order in which the conditions given in the 'WHERE' clause are imortant

Hi All,
Is the order in which the conditions are given in the 'WHERE' clause are important for
performance with regard to oracle query plan.
Regards

Short answer: no.
Longer answer: Well. probably not. If you are using very old versions of the database or the rule-based optimizer, you can probably find some corner cases where it mattered. If you are using a vaguely recent version of the database with the cost based optimizer, it shouldn't matter-- the optimizer is free to evaluate the conditions in whatever order it would like and it chooses to do so in the order that it expects to be most efficient. That said, as the number of objects and conditions increases, the number of possible permutations the CBO tries to consider increase dramatically to the point that an exhaustive analysis of all possible conditions isn't feasible. In that case, the optimizer will have to make a reasonable effort to explore the set of possible plans rather than doing an exhaustive search-- the order of conditions is likely to matter slightly in the optimizer's choice of which branches to explore and which to prune if there are many conditions with similar (or identical) costs. Now, that being said, it is very unlikely that you could do anything useful with this knowledge that would be able to force the optimizer to do something that you'd want. It's possible to do, of course, it's just not a particularly useful way of influencing the optimizer.
Justin

Similar Messages

  • SAP report showing sales orders on which pricing conditions have been chang

    Is there a SAP report that shows a list of sales orders on which pricing conditions have been changed.
    My knowledge is:
    Review pricing condition transaction data table (‘KONV’) helps is some way.

    Hi Ashish,
    I don't know any such a report, but I guess you can play arround with table CDPOS.
    Change doc. object = VERKBELEG
    Table Name = KONVC.
    Actually this will take lot of time.
    Thanks,
    Mandar

  • Force the order in which WHERE clauses are applied?

    I need to make sure that one where clause filtering is applied before the other. How do I do that?
    Several of my where clauses are below.
    I need to make sure than the where clause in bold is applied before several where clauses on the bottom. Otherwise, I get error: division by 0.
    where ...
    and a.surveydate = (select max(surveydate) from survey
    where id = a.id
    and surveydate < b.surveydate
    and b.surveydate between TO_DATE('&lowdate','DD-MON-YYYY')
    and TO_DATE('&highdate','DD-MON-YYYY')
    and (
    ( abs( (b.totvacant/totunits - a.totvacant/totunits) /
    (b.surveydate - a.surveydate) * 365 ) >= 0.00 )
    or ( abs( (b.avgcost/ a.avgcost -1 ) /
    (b.surveydate - a.surveydate) * 365 ) >= 0 )
    or ( abs( (b.free_rent - a.free_rent ) /
    (b.surveydate - a.surveydate) * 365 ) >= 0 )
    Thank you. I know very little about query optimization, but I have a sense that I need to use some kind of SQL hint.

    Why not rewrite the where clause a bit to intercept »ORA-01476: divisor is equal to zero«?:
    SELECT *
      FROM tab
    WHERE a.surveydate =
              (SELECT MAX (surveydate)
                 FROM survey
                WHERE ID = a.ID
                  AND surveydate < b.surveydate
                  AND b.surveydate BETWEEN TO_DATE ('&lowdate', 'DD-MON-YYYY')
                                       AND TO_DATE ('&highdate', 'DD-MON-YYYY')
                  AND (   (ABS ((b.totvacant / totunits - a.totvacant / totunits
                                / NULLIF (b.surveydate - a.surveydate, 0) * 365
                               ) >= 0.00
                       OR (ABS ((b.avgcost / a.avgcost - 1)
                                / NULLIF (b.surveydate - a.surveydate, 0) * 365
                               ) >= 0
                       OR (ABS ((b.free_rent - a.free_rent)
                                / NULLIF (b.surveydate - a.surveydate, 0) * 365
                               ) >= 0
                      ))

  • Validating a selection field for meeting the ranges given in the Domain

    Hi Experts,
    Please let me know the proceedure to  Validating a selection field for meeting the ranges given in the Domain.
    In my case, i am using the domain 'AUFTYP' Order category which has value range like 01 , 02 .... Which are displyed during F4 help.
    Please advise to validate these ranges.
    Thanks in advance,
    Viven

    Hi,
    If the values are maintained at domain level guess the check will be done automatically. You dont have to validate the entries in the field.
    Cheers
    VJ

  • Can the Condition records in the transaction NACE be transported?

    Can we Transport the Condition records in the transaction NACE from one system to another ( I mean from Dev to Quality).
    I have navigated through all the menu in the transaction NACE but haven't found any link for transport.
    Any help pls.

    Hi,
    Please find the bellow thread which is related to NACE transaction.
    <<link removed>>
    Regards,
    Goutam Kolluru.
    Edited by: goutam kolluru on Feb 1, 2012 4:56 AM
    Edited by: kishan P on Feb 1, 2012 11:48 AM

  • Does the condition specified in the function 'DECODE' allow 'BETWEEN' expression?

    Does the condition specified in the function 'DECODE' allow 'BETWEEN' expression?

    As a completely different approach, in 8i SQL and 9i PL/SQL we can use the CASE function. This delivers decode functionality, but allows us to use conditions e.g.
    SELECT CASE WHEN col BETWEEN 1 and 9 THEN 'one' ELSE 'two' END FROM my_table;I love DECODE and wouldn't use anything else for straight value substitutions but CASE does have the advantage of clarity when it comes to maths, etc. Also I believe DECODE is not ANSI compliant. In which case (ho ho!) I suspect it will probably be deprecated, as Oracle seems to be moving towards ANSI SQL compliance, as part of its open standards drive.
    Cheers, APC

  • How to find out the condition type of the tax code in the PO document

    Hi friends,
    My questions is how to find out the condition type of the tax code in the PO document.
    When you use me23n to display one PO document. In the invoice tab, there is one text field named 'tax code' whose value could be T1, T2, J1, J2 and so on. Beside the text field, there is one button named taxes. When you click the button taxes, it will show you the condition type of the tax code. For example, if the tax code is 'T1', then its condition type 'mwcn'.
    I want to use the information on the PO to find out the value 'mwcn' of the tax code 'T1'. Could anybody help to describe the logic?it looks like the value is saved in the table konp. But I don't know the logic. Please describe. Thank you.

    Hi,
    Hope you have asked for select query..
    select single knumh from a003 into wa_knumh
      where mwskz = wa_itpotab-mwskz
      and kappl = 'TX'
      and aland = 'IN'.
    select single kbetr from konp into wa_kbetr
      where knumh = wa_knumh.
    cheers,
    Dep

  • Can I record/log the answers given for the review questions

    Hi All,
    Searched but did not find the answer to this.
    Is it possible to record/log the answers given for the review questions at the end of each chapter. Logging to the device would be fine but logging to a remote server would be ideal?
    Thanks in advance for any help here -

    Thanks K T,
    Would it be possible to embed a Dashcode widget that would present a simple questionaire and post these to a server instead?
    Re: localStorage can that be accessed from the iBook and record the inputs?
    Again thanks in advance

  • How to update the condition price in the sales order for all the items

    Hi,
    How to update the condition price for all the itmes in the sales order to carry out the new price automatically through a stand alone program, for all the orders in the billing due list table?
    Thanks,
    Balaram

    Hi,
    There is a change in the requirement.
    Scenario:
    I have created a sales order with some 4 condition types, in that 2 condition types are of class A & B and the other two is of class C. Here I need to update the condition price of class A & B only and the remaining condition types should not get update even though there is an updated price is available.
    For the above scenario, I need to write a standalone program. Do we have any function modules to update the price of the single condition in the sales order? Please tell me how we can update the sales order at item condition level.
    Thanks.
    Balaram

  • How do I remove Bing from my toolbar at the top of the page. I have already tried both of the suggestions given in the help section; I could not find Bing in my control panel "add and remove programs," and there was one other suggestion which I also tried

    ''locking due the age of this thread - asked and answered''
    I have tried all of the suggestions given by FF in order to remove Bing from my computer but nothing seems to work. I would appreciate some advise. For instance when I go to add and remove programs I can't even find Bing listed. Looking forward to your suggestions. Thanks.
    == This happened ==
    Every time Firefox opened
    == I first installed Firefox

    Right click "Tools". Uncheck "Search Toolbars".

  • Loading data in the order in which it is inserted in the file

    Hi All,
    I am trying to load data from a flat file in database table using sql Loader.
    The loader loads all the data successfully without giving any error.
    The problem is the data is not inserted as it is in the file i.e.
    Line 1 in datafile is inserted in row 10 in table,
    Line 2 in datafile is inserted in row 1 of db table.
    I want line 1 in datafile to be on row 1 of DB table and line 2 in row 2 etc.
    If anybody has any solution.
    Thanks in advance.
    Harjit

    Many thanks to everybody who have given there valuable time.
    But what i have found the solution and it lies in this keyword "SEQUENCE(MAX,1))"
    Try doing this
    LOAD DATA
    INFILE *
    truncate
    INTO TABLE emp11
    FIELDS TERMINATED BY "," OPTIONALLY ENCLOSED BY '"'
    (empno, ename, job, mgr,
    s_no SEQUENCE(MAX,1))
    BEGINDATA
    7782, "Clark", "Manager", 7839
    7839, "King", "President"
    7934, "Miller", "Clerk", 7782
    7566, "Jones", "Manager", 7839
    7499, "Allen", "Salesman", 7698
    7654, "Martin", "Salesman", 7698
    7658, "Chan", "Analyst", 7566
    Thanks again

  • The backlight on my ipod touch 3rd generation will not come on, but everything works perfectly. I even used the advice given on the tech support page, and it still will not come on. HELP ME PLEASE.

    The backlight on my ipod touch 3rd generation will not come on, but everything else is working fine I even took the tech support advice by plugging it in and resetting it, but that didn't fix the issue either. I need help.

    If not this:
    iOS: Wi-Fi or Bluetooth settings grayed out or dim
    One user reported that placing the iPod in the freezer fixed the problem.
    Also heating sometimes works. See:
    Why can't I select my wifi settings?
    A trick that works frequently with iPhones:
    Settings > AirPlane Mode ON, Do Not Disturb ON
    Power down and wait 5-10 minutes
    Power up
    Settings > AirPlane Mode OFF, Do Not Disturb OFF
    If not successful, an appointment at the Genius Bar of an Apple store is usually in order.
    Apple Retail Store - Genius Bar
    Then:
    Does the iOS device connect to other networks? See other networks? If yes that tends to indicate a problem with your network.
    Does the iOS device see the network?
    Any error messages?
    Do other devices now connect?
    Did the iOS device connect before?
    Try the following to rule out a software problem:                
    - Reset the iOS device. Nothing will be lost
    Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Power off and then back on your router
    .- Reset network settings: Settings>General>Reset>Reset Network Settings
    - iOS: Troubleshooting Wi-Fi networks and connections
    - Wi-Fi: Unable to connect to an 802.11n Wi-Fi network      
    - iOS: Recommended settings for Wi-Fi routers and access points
    - Restore from backup. See:
    iOS: How to back up
    - Restore to factory settings/new iOS device.
    If still problem and it does not connect to any networks make an appointment at the Genius Bar of an Apple store since it appears you have a hardware problem.
    Apple Retail Store - Genius Bar

  • Applying the corrections given in the SAPNOTE

    gurus ,
    i found a solution to my problem in an SAPNOTE . in that they have given to apply a correction .
    but so far i have not applied any correctins .
    how to apply that .
    i need to apply note 1036427 & 1011377  ....
    ikindly guide me how to apply the corrections given in that
    hoping for your quick and valuable response

    Hi Susin.
    I check both the notes , there is no need of manual coding to that as per my knowledge.
    These notes are processed by the system itself.
    Pls goto SNOTE ( tcode) then in the menu -> goto -> download sap note.
    give the sap note number there and click ok , then it will be downloaded and can be seen in  under sap -> New .
    Then go into New  and select the sap notes that downloaded and execute.
    If there are any manual interventions needed then the system will specify that .
    Then after executing the note will come under sap - In processing.
    If the green tick mark comes the notes is successfully implemented other a waring or error message comes , if error message comes then click on that you will see what all are missing.
    Pls kindly let me know what error messages you are getting after executing the note so that we can help you to implement the note successfully.
    Regards,
    Vvieks

  • Flash plugin has crashed and I have tried all the solutions given on the site..never happened before until i updated firefox for the past 1-2 months?

    Flash plugin crashes a lot more frequently since I updated it (the past month or so??) I have tried the latest Firefox version 3 and updated it to version 4.
    I have tried all the solutions given such as complete uninstalling or changing the integer to -1

    I'm not sure anyone here knows more about the Java plugin than you do...
    Were you starting the control panel from disk as administrator because it didn't work starting it through the Start menu (if you have Control Panel set to View by Category, the Java control panel is under "Programs").

  • Hi sir...my firefox is having this peculiar problem ..i have tried all the steps given in the prevoius page..but youtube video is not buffering...

    initially it buffers for a second...suddenly message appears 'error occured..'...only youtube is having this problem..other website videos buffers fine..i have tried all the solutions you have given in the these pages...but its not working..please help me out...

    Thank you for your question, we are currently investigating the cause of this and a work around. Currently there was a blocking of a number of ips in India that has had a large affect on Firefox/Youtube users.
    Suggestions for troubleshooting this issue have been:
    *"Clear the Cache":
    Firefox/Tools > Options > Advanced > Network > Cached Web Content: "Clear Now"
    *"Remove Cookies" from sites causing problems:
    Firefox/Tools > Options > Privacy > "Use custom settings for history" > Cookies: "Show Cookies"
    *As well as temporarily changing dns to 8.8.8.8
    *Flushing the dns cache on the computer
    *File may be unavailable, please try again later.
    *Disable all video players from [about:addons] and see if it will play from the default HTML5 player.
    Please post back with your results, it could help other users. Thank you.

Maybe you are looking for