Optimizer Hint after Order By

Hi,
We have order by person_id in query which returns 10000 records.
We have included FIRST_ROWS(20) as Optimizer Hint.
Will Order by impact Optimizer Hint ?
Thanks,
Kiran

914684 wrote:
Hi,
We have order by person_id in query which returns 10000 records.
We have included FIRST_ROWS(20) as Optimizer Hint.
Will Order by impact Optimizer Hint ?
Thanks,
Kiran
no

Similar Messages

  • How to include optimizer hints in Discoverer

    We have a Discoverer report which used to run fine prior to DB migration from (9.2.0.6 to 10G Rac 10.2.0.4).
    Since the database is migrated to 10g RAC same reports is running for longer time and failes with ROW_ID error,
    we ran the sql generated by the report in SQL Plus with below optimizer hint.
    Select /*+ optimizer_features_enable('9.2.0') */
    this query ran well with optimizer hint, but i am wondering how to use the optimizer hint in Discoverer Plus/Desktop.
    Select /*+ optimizer_features_enable('9.2.0') */
    C.EMPLOYEE_NUMBER||' '||A.EMPLOYEE_NAME, A.REPORTS_TO, C.SERVICE_CODE, COUNT(B.ACCOUNT_NUMBER)
    FROM PSTAGE.NEW_EMPLOYEE_MASTER A,
    PSTAGE.NEW_ALL_WORK_ORDER_MASTER B,
    PSTAGE.NEW_ALL_WORK_ORDER_DETAIL C
    WHERE ( ( B.WORK_ORDER_NUMBER = C.WORK_ORDER_NUMBER AND B.SITE_ID = C.SITE_ID )
    AND ( A.EMPLOYEE_NUMBER = C.EMPLOYEE_NUMBER AND A.SITE_ID = C.SITE_ID ) )
    AND ( B.WO_STATUS <> 'CN' )
    AND ( C.EMPLOYEE_NUMBER = ANY(SELECT S254_200018.EMPLOYEE_NUMBER
    FROM PSTAGE.NEW_EMPLOYEE_MASTER S254_199317,
    PSTAGE.NEW_ALL_WORK_ORDER_MASTER S254_199854,
    PSTAGE.NEW_ALL_WORK_O
    Thanks in advance

    Hi Sunil
    In the Administrator tool, you can add hints to the driving folder used in your query. A first glance at your report seems to indicate that B might be the driver.
    If you launch the Administrator tool, open the business area then right-click on the folder in question you can select Properties. The second to last property is called Optimizer hints. Try setting the same hint in here exactly the way you would do it inside SQL.
    I am not 100% sure whether this would take as this isn't a folder hint per se, but it is worth a try. You might also want to look at this thread: how to design Optimizer hints  to the generated SQL
    Another thing to check is to look at the code that is being generated by your Discoverer worksheets. Do you by chance see a NOREWRITE hint being added? This is a common issue with newer systems. This hint tells the database that the query cannot be rewritten which in most cases will cause poor performance. If this is happening to you I advise you to disable that hint. This is done by editing the pref.txt and adding a new preference called
    Out of the box, Discoverer Plus will sometimes add the NOREWRITE hint. This will cause Plus worksheets to operate much slower than Desktop worksheets. You can disable the NOREWRITE hint by adding a new preference called UseNoRewriteHint to pref.txt in the Database section. After you have done this you will have to run the apply preferences script.
    [Database]
    UseNoRewriteHint = 0
    Be sure to close all of your IE windows so that a new JVM is loaded.
    For example, you might turn on UseNoRewriteHint (i.e. set it to 1) if you want users to always query against the latest data (e.g. created today), even though this might be slower than querying the summary data (e.g. created yesterday). The NOREWRITE hint instructs the optimizer to disable query rewrite for the query block, which overrides the setting of the parameter QUERY_REWRITE_ENABLED.
    Default Value: 0
    Valid Values
    0 = Do not add the NOREWRITE hint. This is the one I recommend.
    1 = Do add the NOREWRITE hint.
    Another possible area is with query prediction. This is taken from an Oracle Note: Under some circumstance when you run a query against an Oracle 10g database, the queryprediction might take up the majority of time and CPU may hit 100%.
    The cause for this is an an Oracle10g (10.1) database issue but seeing as you are on 10.2 this might not be an issue any more. I throw it out there just in case you still hvae issues and want to raise this with Oracle. The last I heard is that the root cause was still under investigation in an unpublished Bug:4024370. There was a workaround to the issue:
    1. Disable Query Prediction (strongly recommended anyway):
    For Plus/Viewer:
    Edit pref.txt on the middle-tier server and set QPPEnable=0
    Run the applypreferences script (.sh or .bat)
    For Desktop:
    Edit the registry and set QPPEnable=0
    HKEY_CURRENT_USERS\Software\ORACLE\Discoverer <version>\Database
    2. If you still wish to use Query Prediction while the database issue is being investigate, then you can configure the Query Predictor to use the Explain Plan method rather than the Dynamic Views method.
    For Plus/Viewer:
    Edit pref.txt on the middle-tier server and set QPPObtainCostMethod=0
    Run the applypreferences script (.sh or .bat)
    For Desktop:
    Edit the registry and set QPPObtainCostMethod=0
    HKEY_CURRENT_USERS\Software\ORACLE\Discoverer <version>\Database
    Hope this helps
    Best wishes
    Michael

  • ODBC Driver adds ROWID next to SELECT and disables the optimizer hint

    I want to use an optimizer hint in my sql statement. For example: "select /*+ index(emp,status) +*/ status,name from emp where status=1". I have a bitmap index on status field, i want to force the select statement to use it. This one works fine from sql plus. If i execute the same statement from a VB application and run it via ODBC [Microsoft driver or oracle driver] it's sending the statement like "select rowid,/*+.....+*/ ...". I believe hint has to be next to the word SELECT, so it's not being used. I want to create an ADO connection from the vb application and create a recordset and loop through it and update some values. Any thoughts?
    I tried some other options...like
    select * from (select /*+ index(1,2) +*/....)
    select a.* from (select /*+ index(1,2) +*/...) a
    cn1.execute(sqltext) from vb..
    In all these three methods it's not adding a rowid next to select.. so hint is used and able to use the index. But having issues with updating the recordset. It says "query is not from one table" and "can't be updated" errors..

    The ODBC drivers are going to need to select the rowid in order to get an updatable or a scrollable recordset. Otherwise, they won't know which row in the database to update or how to fetch the previous rows without caching the entire recordset.
    Can you create a view from the hinted select statement and select from that? That's likely to be the fastest solution.
    Justin

  • Optimizer Hint in Mapping

    Is it possible to add an optimizer hint to a dimension or cube mapping?
    OLAP Analytic Workspace 11.2.0.4.0
    Oracle OLAP API 11.2.0.4.0
    OLAP Catalog 11.2.0.4.0
    AWM 11.2.0.4.0B

    I would like to better understand what you are trying to optimize with a hint on a dimension or cube mapping?
    Could you provide a use-case of a specific hint that you think would help performance of a
    dimension or cube load. The mapping of a dimension or cube is for loading data from a relational source
    i.e. table or view into the OLAP dimension or cube. The OLAP option has highly optimized load SQL for
    reading in the dimension or cube data. The SQL that is generated is done in such a way as to maximize the
    overall efficiency of getting the OLAP dimension and cube completely built and solved. As you know, the
    internal OLAP dimension and cube data structures are somewhat complex and need to be built in a
    highly performant manner.
    Again, I am curious on what your thoughts are about injecting a SQL hint on a mapping to improve the load
    performance and solve performance of a build.
    Here is an example of a dimension load SQL query. You can look at the build log information to get all this detail.
    SELECT DISTINCT /*+  bypass_recursive_check */
      RTRIM(NVL2(T9."SHIP_TO_ID", TO_CHAR(('SHIP_TO_' || T9."SHIP_TO_ID") ) , NULL) )  ALIAS_1
    FROM
      GLOBAL."CUSTOMER_DIM" T9
    WHERE
      (T9."SHIP_TO_ID" IS NOT NULL)  
    UNION
    SELECT DISTINCT /*+  bypass_recursive_check */
      RTRIM(NVL2(T10."WAREHOUSE_ID", TO_CHAR(('WAREHOUSE_' || T10."WAREHOUSE_ID") ) , NULL) )  ALIAS_2
    FROM
      GLOBAL."CUSTOMER_DIM" T10
    WHERE
      (T10."WAREHOUSE_ID" IS NOT NULL)  
    UNION
    SELECT DISTINCT /*+  bypass_recursive_check */
      RTRIM(NVL2(T11."ACCOUNT_ID", TO_CHAR(('ACCOUNT_' || T11."ACCOUNT_ID") ) , NULL) )  ALIAS_3
    FROM
      GLOBAL."CUSTOMER_DIM" T11
    WHERE
      (T11."ACCOUNT_ID" IS NOT NULL)  
    UNION
    SELECT DISTINCT /*+  bypass_recursive_check */
      RTRIM(NVL2(T12."REGION_ID", TO_CHAR(('REGION_' || T12."REGION_ID") ) , NULL) )  ALIAS_4
    FROM
      GLOBAL."CUSTOMER_DIM" T12
    WHERE
      (T12."REGION_ID" IS NOT NULL)  
    UNION
    SELECT DISTINCT /*+  bypass_recursive_check */
      RTRIM(NVL2(T13."MARKET_SEGMENT_ID", TO_CHAR(('MARKET_SEGMENT_' || T13."MARKET_SEGMENT_ID") ) , NULL) )  ALIAS_5
    FROM
      GLOBAL."CUSTOMER_DIM" T13
    WHERE
      (T13."MARKET_SEGMENT_ID" IS NOT NULL)  
    UNION
    SELECT DISTINCT /*+  bypass_recursive_check */
      RTRIM(NVL2(T14."TOTAL_CUSTOMER_ID", TO_CHAR(('TOTAL_CUSTOMER_' || T14."TOTAL_CUSTOMER_ID") ) , NULL) )  ALIAS_6
    FROM
      GLOBAL."CUSTOMER_DIM" T14
    WHERE
      (T14."TOTAL_CUSTOMER_ID" IS NOT NULL)  
    UNION
    SELECT DISTINCT /*+  bypass_recursive_check */
      RTRIM(NVL2(T15."TOTAL_MARKET_ID", TO_CHAR(('TOTAL_MARKET_' || T15."TOTAL_MARKET_ID") ) , NULL) )  ALIAS_7
    FROM
      GLOBAL."CUSTOMER_DIM" T15
    WHERE
      (T15."TOTAL_MARKET_ID" IS NOT NULL)   
    ORDER BY
      1 ASC NULLS LAST

  • How to prevent PO changes in ME22N after Order acknowledgement?

    Hi everyone,
            Can anyone tell me how to prevent PO changes (ANY) in ME22N after Order acknowledgement?
            I would like to make it possible without release strategy process or authorizations.
            Do you know some User Exit or Customazing way?
    Regards.
    Jaime S.

    Dear Jaime S,
    You can do this by restricting in authorization SHDO and also by marking "changes not possible after release" in Release strategy procedure.
    And also you can navigate the menu to, SPRO------>IMG------>Material Management--->Purchasing(OLME)------->Purchase Order---->Define screen Layouts at Document Level---->And go to ME22n And Select the right parameter and in this you can make it display, optional or required entry for the fields.
    Regards,
    Manjunath B L

  • BOM explosion date after order finish date

    Hi
    We have issue with BOM explosion date. In process order, BOM explosion date is geting calculated after order finish date.
    Any idea why this is happening.

    Hi,
    Just to understand the issue better, can you list the scheduled and basic dates on the order.
    Anup.

  • Hello. I am trying to buy to student edition of Acrobat XI-Pro but there isn't a student felt before or after order. Is there anyone who knows how this happens?

    Hello. I am trying to buy to student edition of Acrobat XI-Pro but there isn't a student felt before or after order. Is there anyone who knows how this happens?

    Hi,
    Please refer to the below mentioned article for further information on this.
    Student software discounts, student eligibility | Adobe
    Thank,
    Vikrantt Singh

  • Display Hint after 3 incorrect clicks

    I have recorded a training simulation and very much enjoy the
    "Hints" which are displayed when you rollover a click box. However,
    I would like to know how you can automatically display the hint
    after 3 incorrect clicks (or clicks outside of the click box). This
    seems like it would be an easy enough thing to do and someone has
    probably done it or knows how - I just cant figure it out since I'm
    still learning captivate.
    Thanks

    I know this is an old thread, but I came up with a solution to this problem after some digging that I think might work incase anyone else has come across this problem. My method was as follows.
    1. Create two click boxes, identical in size and stacked on top of each other in the stage. Set them one after the other in the timeline - I put the first one on bottom in the but it doesn't really matter in the layers because the click boxes do not operate simultaneously. Also create a text caption that contains the hint you want to give your user. Place the text caption under the click box in the time line so it does not overlap with the first text box.
    2. On the first click box, set the options to...
    On Success: Go to the next slide
    Attempts: 3
    Last Attempt: Continue
    No success, failure, or hint captions
    Others: Only Pause project until user clicks.
    2. On the second box, set the options to...
    On Success: Go to the next slide
    Attempts: Infinite
    No success, failure, or hint captions
    Others: Only Pause project until user clicks.
    That's it. It will pause on the first click box until the three attempts are spent, then it will play the second click box as it shows the hint.

  • End Planning Run After Order Selection - issue not clearing down all plans

    Hi,
    We are using the CTM Profile with "End Planning Run After Order Selection" ticked in the basic settings tab in order to clear down previous CTM runs. So we have a CTM deletion profile.
    The issue is that it requires more than one execution to clear down the Planned Orders / Purchase Requisitions. You execute the Deletion CTM Profile once and it will clear down some of the Purchase Requisitions and Planned Orders and leave some still in place. You then have to execute the deletion CTM profile one or two more times in order to delete the remaining Planned Orders / Purchase Requisitions.
    This is clearly not realiable for a batch process to clear down plans. Has anyone else experienced this and does anyone have a solution. The solution cannot be based on RLCDELETE or /SAPAPO/DELETE_PP_ORDER
    Mark

    Hi,
    Can you check your planning mode and deletion mode combination defined in the ctm profile.
    Prerequisties for deleting the orders:
    u2022 They are within the planning and deletion periods
    u2022 They do not have pegging relationships with demands outside of the planning period
    They lie outside of the production horizon, stock transfer horizon and the planned delivery time
    In addition, all location products of an order must be included in the Master Data Selection so that CTM can
    delete the order. Also, CTM cannot delete any manually fixed orders.
    If you have selected the SNP Order order type in the CTM profile, CTM cannot delete any PP/DS orders. This
    restriction is also valid the other way round for the PP/DS Order order type. If you select this order type, CTM also
    deletes SNP orders.
    Thanks,
    nandha

  • Optimizer Hint

    When I set the Optimizer Hint property to something like /*+ INDEX(Fin_Budgets Bud_PK)*/ at design time and query the form then the default query does not include the hint I passed. But when I set it programmatically via Set_Block_Property it does include. I checked the :system.last_query system variable in Post-Query trigger.
    Is this is a bug ????
    Your answers and view are appreciated.
    Thanks in advance
    Asif Momen

    When I set the Optimizer Hint property to something like /*+ INDEX(Fin_Budgets Bud_PK)*/ at design time and query the form then the default query does not include the hint I passed. But when I set it programmatically via Set_Block_Property it does include. I checked the :system.last_query system variable in Post-Query trigger.
    Is this is a bug ????
    Your answers and view are appreciated.
    Thanks in advance
    Asif Momen

  • Apporval Overview displays incorrect status on item level after ordering

    Hi all,
    I am on SRM 7.0 and using the process-controlled workflow.
    I am on SP2.
    I set up a schema which has 1 approval step for SC > $10.000. The decision set is for the entire document.
    When I am creating the SC, BEFORE I hit order, I click on the item number of eg. my first item, so the 'Details for item 1' screen appears.
    Then I choose the  'Approval Process Overview' tab, and the approval overview displays correctly. The status of the one approver step is  'Open (No Decision Made)', under both header and item tab.
    When I display the same SC trough 'advanced search' immediatley AFTER ordered it and no approver has touched the SC yet,
    the overview the item displays the correct status 'awaiting approval'.
    But when i go to the item details, approval process overview tab (as described above) the status displays 'User Decision: Approved'
    There is no time entered for 'processed on'. The approver does have the workitem in the powl list and swi6 shows correlty that the workitem is in the approver inbox. So the approval workflow is working correctly, and it is just a display issue.
    It looks like it is just a bug, but I couldn't find any notes on it.
    Can anybody help me to correct this?
    Cheers
    Ulrike

    Hi Ulrike,
    I replicated exactly the steps your described but do not see the same system behaviour. On my system, just after creating the cart, in the section 'Approval status details for selected item', the status is 'No user decision'.
    I searched notes and messages and found nothing related to this issue.
    Can you send me screenshots showing exactly the steps you followed just to make sure I am following same steps in the replication.
    Cheers,
    Siobhan

  • Which optimizer hint should i use?

    Hi,
    I need a query which has a join of 5 different tables which have more than 1 million records each. Which optimizer hint should be best for my query?
    Thanks,
    Sumit.

    Define what is "best" for you. Also, are you using RBO ? Why in first place you need hint ? Is your query performing poorly ? Have you measured current performance ? Most importantly, have you defined your performance goal ?

  • 'Optimizer Hint' property bug (or feature) {Urgent}

    Dear Oracle Developer Community & Support Team!
    I've defined 'Optimizer Hint' block property at design time
    but it hasn't affected the resulting query.
    Then I've defined it with the Set_Block_Property procedure and
    it worked then.
    Could you tell me was it a bug or a feature?
    Sincerely yours,
    Elias.
    null

    Elias Gershanov (guest) wrote:
    : Dear Oracle Developer Community & Support Team!
    : I've defined 'Optimizer Hint' block property at design time
    : but it hasn't affected the resulting query.
    : Then I've defined it with the Set_Block_Property procedure
    and
    : it worked then.
    : Could you tell me was it a bug or a feature?
    : Sincerely yours,
    : Elias.
    This is a known feature. Optimizer hint can only be set at
    runtime. I don't know why.
    Dear Oracle Team, would you be so kind to explain us that
    feature. And I would like to suggest if possible to change this
    behaviour, so that you can set the property in Design Time.
    Regards:
    [email protected]
    null

  • How to optimize web2 in order to open the window more quickly?

    how to optimize web2 in order to open the window more quickly ?

    salientgreen is right. But my suggestion is that you'd better first transfer these data to your computer to have a backup and then delete them to free up space.
    By the way, you can open Settings and navigate to General > Usage to get an idea of your storage consumption. Music, videos, and photos might be the biggest offender.

  • IPhone 5s missing in apple box after ordering it on release date UPS delivery

    After ordering the iphone 5s gold 32 gb on September 20th, 2013. I waited a month to receive the phone and when it finally came, I opened the UPS box only to find the white apple iphone box opened with a box cutter mark on the back. THE PHONE WAS MISSING!!! Whoever did this left all the accessories in the box and only took the phone. I am furious as I called apple and they told me they will investigate it within 72 hours.
    Here is an image of the iphone box [IMG]http://i41.tinypic.com/258v5eo.jpg[/IMG]

    Me too!!!!
    Over a month ago I ordered the 5S in gold, 32 GB.  I picked it up from UPS, got home, opened the box and was IN SHOCK to find NO PHONE! Stunned. Just got off the phone with Apple customer service. Now I get to wait.... again.

Maybe you are looking for

  • Creating Return Order in ME21N

    Hi Experts, How to create a Return Order in ME21N? What are the mandatory fields etc? If anybody has a link to step-by-step procedure to create a Return Order in ME21N, That will be of greate use to me. Thanks in advance, Sreenivas Reddy

  • Trackpad acting weird after spill

    Hi, I am in kind of a problem right now. My trackpad is acting weird after some juice spilled over it from a drinking straw. Everything else works fine. I have turned the power off just to be safe. I need advice as to what to do. I bought my mac (lat

  • TS1389 how do i authorize my computer

    i need to authorize my computer i my computer because i had two previous computers that broke an wanted to have only one computer showing as authorized this is really making me mad.  will some one help me fix the problem.   it says go to store click

  • Integration of J2EE application with weblogic portal

    Hi guys, I have an application hosted on an iplanet web server. This application uses servlet 2.2, jsp 1.1 of J2EE platform. And I have a microsoft application running on .NET platform. I want integrate above 2 applications into webloigc 8.1 portal.

  • ADS connection error

    hi I am trying to connect the ADS which is configured in SAP Netweaver 7.4 (Portal)  from SAP ECC server . When i try to test the connection using SA59 Transaction using the following program FP_TEST_00, i am getting the following error. can any one