How To Handle Stale Stats Scenario.

hi ,
I am using Release 10.2.0.1.0 of Oracle. I am having a scenario in which i am getting poor execution plans due to stale stats , and how should i tackle the scenario. below is the part of my main query which deviates the execution path due to wrong cardinality estimation.
      My column c1 of table tab1 holds javatimestamp values i.e. its NUMBER datatype which points to a date and time component only. And we gather stats each weekend on this table tab1.
      below is my query:
      select /*+gather_plan_statistics*/* from tab1         
      where c1 BETWEEN 1346300090668 AND 1346325539486    ;     
Plan hash value: 3167980259
| Id  | Operation                   | Name                    | Starts | E-Rows | A-Rows |   A-Time   | Buffers | Reads  |
|   1 |  TABLE ACCESS BY INDEX ROWID| tab1                    |      1 |   1    |    167K|00:01:13.72 |     158K|  12390 |
|*  2 |   INDEX RANGE SCAN          | IDX_N1                  |      1 |   1    |    167K|00:00:13.27 |   13880 |   1736 |
     Above shows a big gap in actual and estimated cardinality estimation, and its due to the fact that the HIGH_VALUE (1346203206173 points to 8/29/2012 1:20:06 AM) in DBA_TAB_COLUMN for     column C1 is well below  the STARTRANGE(1346300090668 points to 8/30/2012 4:14:51 AM) and ENDRANGE(1346325539486 points to 8/30/2012 11:18:59 AM) of the BETWEEN clause.
     So even gathering stats daily on the table wont help me as because, in morning again it will require updated maxvalue for the column C1 for estimating proper, So how to handle this situation?  Dont want to go with 'hint' , want to make the stats proper so that optimizer will automatically pick the right path.Edited by: 930254 on Aug 30, 2012 4:41 AM

930254 wrote:
hi ,
I am using Release 10.2.0.1.0 of Oracle. I am having a scenario in which i am getting poor execution plans due to stale stats , and how should i tackle the scenario. below is the part of my main query which deviates the execution path due to wrong cardinality estimation.
      My column c1 of table tab1 holds javatimestamp values i.e. its NUMBER datatype which points to a date and time component only. And we gather stats each weekend on this table tab1.
      below is my query:
      select /*+gather_plan_statistics*/* from tab1         
      where c1 BETWEEN 1346300090668 AND 1346325539486    ;     
Plan hash value: 3167980259
| Id  | Operation                   | Name                    | Starts | E-Rows | A-Rows |   A-Time   | Buffers | Reads  |
|   1 |  TABLE ACCESS BY INDEX ROWID| tab1                    |      1 |   1    |    167K|00:01:13.72 |     158K|  12390 |
|*  2 |   INDEX RANGE SCAN          | IDX_N1                  |      1 |   1    |    167K|00:00:13.27 |   13880 |   1736 |
     Above shows a big gap in actual and estimated cardinality estimation, and its due to the fact that the HIGH_VALUE (1346203206173 points to 8/29/2012 1:20:06 AM) in DBA_TAB_COLUMN for     column C1 is well below  the STARTRANGE(1346300090668 points to 8/30/2012 4:14:51 AM) and ENDRANGE(1346325539486 points to 8/30/2012 11:18:59 AM) of the BETWEEN clause.
     So even gathering stats daily on the table wont help me as because, in morning again it will require updated maxvalue for the column C1 for estimating proper, So how to handle this situation?  Dont want to go with 'hint' , want to make the stats proper so that optimizer will automatically pick the right path.Edited by: 930254 on Aug 30, 2012 4:41 AMUm, refresh the stats on a regular basis?
Oracle 10 and later has a default job to do that. Runs at 2200 daily.
If you need an 'on demand' refresh, that's easy enough to set up.

Similar Messages

  • Question on "How to Handle Inv management Scenarios in BW" docuemnt.

    Hi all,
    I read the document "How to Handle inventory management scenarios in BW" and I did not understood what a snapshot scenario is?  Can anyone tell me what is the difference between snapshop and non-cumulative scenario's.
    thanks,
    Sabrina.

    In a non-cumulative scenario the current stock of any day (or month) is not stored physically in the cube. Instead the stock values over time is calculated dynamically at query runtime by the BW OLAP engine, which basically derives the stock by summing up the periodic value changes (cumulative inflow and outflow of the non-cumulative key figure), which are stored in the cube (together with a so called stock marker used as the basis of the calclation).
    In the snapshot scenario the current stock of any month is calculated in a snapshot ODS and then loaded to a cube. This means that the the stock value is physically stored in the cube in an ordinary cumulative key figure.
    Since a non-cumulative cube store value changes and not the actual stock this means that performance might be bad if there are many value changes for each characteristic combination in a month (since the stock is calculated at runtime and many records must be processed to derive the stock). So in this case the snapshot scenario is better since no runtime calculations of the stock need to occur  and since only one record, containing the actual stock value will be stored in each month for each characteristic combination having a stock value.
    I think you would be better of with an example, but with this explanation in mind looking at the scenarios in the How to again might clarify things...
    Regards,
    Christian
    / Christian
    Message was edited by: Christian

  • How to handle inventory management scenario

    Hi All,
    In How to handle inventory management scenario whitepaper, I fail to understand the basic difference between 'Inventory Management with non-cumulative Key Figures' and 'Inventory Management with Snapshots'. Can anyone please explain me the basic difference.
    Thanks
    PB

    Hi Loic
    Can u please see if all the steps listed below are OK.
    While setting up  the IM Scenario
    I have jotted down the steps with valuable inputs from you  and paper 'How to Hanlde IM scenarios'
    Please find the steps below. Kindly review them and let me know in case I have got anything wrong or missed out on anything.
    1. Transfer Business Content Datasources 2LIS_03_BX , 2LIS_03_BF, AND 2LIS_03_UM in RSA5.
    2. Go to Transaction LBWE, Activate Datasources 2LIS_03_BF, AND 2LIS_03_UM.
    3. Go to Transaction MCB_ select SAP BW usage 'Standard' Radio button.
    4. Save it.
    5. Go to Transaction MCNB, enter name of run ‘Stock_init’. Enter Termination date in future. Enter Datasource as 2LIS_03_BX.
    6. Execute the initialisation.
    7. Entries can be found in SETUP Table MC03BFSETUP & MC03BFSETUP.
    8. Run SETUP for 2LIS_03_BF, AND 2LIS_03_UM using TCodes OLI1BW and OLIZBW respectively.
    9. Run the extraction for 2LIS_03_BX in BW.
    10. Compress the request with ‘No Marker Update’ NOT SET i.e. unticked or unchecked.
    11. Run the extraction for 2LIS_03_BF in BW.
    12. Compress the request with ‘No Marker Update’ SET i.e. ticked or checked.
    13. Run the extraction for 2LIS_03_UM in BW.
    14. Compress the request with ‘No Marker Update’ SET i.e. ticked or checked.
    Steps 1 and 2 shall be executed in Development and transported to production and step 3 onward should be carried out in Production itself with Posting Block.
    Thanks in advance.
    Regards
    PB

  • How to handle this Rework Scenario.

    Hello friends,
    Following is the rework scenario that is in Pharma.
    My client produces finish product quantity extra than required. Suppose i have order of 1,00,000 tablets. Production order is created and production is completed. Suppose for this order 1000 tablets are produced extra than order quantity. This extra production is kept in production only. In such way, for each order, extra quantity of finish good  goes on increasing in production.
    Suppose now i have order of 10,000 tablets and in production i have 5000 tablets that are already produced. Now i use this 5000 tablets as rework material. I want that when i run MRP system should generate order of only 5000. I do production of  10000 qty. by using 5000 rework material and 5000 order quantity.
    How can i map this scenario in SAP?
    Thanks

    hi
    Pls. find here step by step procedure for Rework Order :
    REWORK HANDLING PROCEDURE
    There are two way one is manual and another is with trigger point (ref operation set)
    1.Create Rework order without material at CO07 with out material .
    2. Assign the settlement receiver as original production order at settlement rule.
    3. Assign the rework material & component if needed at rework order & assign the issue storage location (unrest- use storage location above).
    4. Do the confirmation for rework order & rework material will be issued from stock to order
    5. GR will not be done for rework order. To get stock for reworked material Do the GR for orginal order & settle the both order .
    Another method,
    1. Create a Reference op set in tcode CA11.
    Enter the plant, Description, usage and status
    for the ref op set
    2. Create a Standard trigger point in CO31.(Ex
    Production)
    Enter the Trigger Point usage /Group as FERT.
    3.Tick the Trigger Point Functions.
    4. Enable the indicator create order with Reference .
    5.Enter the system status as PCNF.
    6.The system will says standard trigger point exists from which you can
    select the created Trigger Point (EXx Production)and save.
    7. MD02/MD04.
    8. Convert the Planned Order into Production Order and Release the order.
    9 .Now confirm th ops.
    10. For the last op enter the yield and rework qty
    and set the status as PCNF.
    11. If the status of last op is PCNF then in the
    system a POP UP will appear as Activited by
    Trigger Point /Create order with reference/order
    number/sequence and op number which trigger point
    works and enter.
    12. Now a rework order will be created.
    13. In c003 enter the number which is next to the actual prodn order no.Rework order will be seen.
    Hope this helps.

  • Posting block Question in How to handle inventory management scenarios

    Hi all - I have a question in document
    <b>"How to...Handle Inventory Management Scenarios in BW"</b>
    can anyone please tell me what a posting block is in this document...
    also I did not understood what a Validity table is?
    thanks,
    Sabrina.

    Hi Sabrina!
    A 'posting block' period is something that now you are facing in inventory management, but you have to consider it in ALL logistic cockpit flows (what you can see in LBWE).
    This requirement can be easily explained in this way: as you know, to fill a setup table you have to activate the extract structure of the datasource for which you want to run the setup job (otherwise the system says that no active extract structure exists, do you remember ?); but, by doing so with the posting operations open (in other words, users can create new document or change the existing ones), you run the risk that these records are automatically included in the extraction queue (or in SM13 if you are using unserialized method) AND also collected in setup table ! And you will have the same records with the initial load (from setup table) and then the same from delta load (from the queue): a nice data duplication.
    To avoid this situation, a "posting block" (or a "free-posting period" or a "downtime") is requested. No one can post new document during your setup job...
    Hope now is clearer...
    Bye,
    Roberto

  • How to handle this payment scenario in SAP

    Hello Gurus,
    Can anyone please help me with how we make this payment in SAP. Customer A is the alternate payer for Customer B. We gave customer B a credit memo. When customer A is making payments, customer A wants to use the credit memo assigned to customer B as a part of the total payment. How does this scenario be handled in SAP
    Thanks in advance

    Hi,
    You can use the Head office and Branch relationship then this should work . All the invoices/Credit memos get updated in the branch office and head office for reporting and at the time of receipt it can be made at the headoffice level
    K.R

  • Question on how to handle United States 401-K catch up deduction

    Just have a question here to see how other Oracle customers in the United States might be handling the 401-K catch up deduction. For 2009, an employee can deduct up to $16,500 in pay as 401-K deductions. That is the limit for this year as set by US law and IRS regulations. However for employees who are age 50 and over, for 2009 they can deduct an additional $5,500 for 401-K, making their total limit for the year $22,000. These limits can change from year to year. Since not all employees are eligible for this catch up amount, you cannot just set one limit amount for 401-K. The way we have attacked it is that we created two elements, one for 401-K and one for 401-K catchup. That mostly works pretty well. The issue we run into is that when an employee hits the limit on the main 401-K deduction, payroll does not automatically roll over and start the catch up deduction, in the same payroll run. In the next payroll run, the catch up deduction will kick in and the employee's paycheck is back to normal. But it is confusing for the employees who hit this situation (which is a small number) because their paycheck ends up a higher amount in the week that they hit the limit on the main 401-K deduction. How have other customers handled setting up the 401-K catch up deduction? Have you been able to get payroll to continue the normal weekly deduction for 401-K even when the employee hits the yearly limit for the regular 401-K deduction? If so, would be curious to hear how you have configured your system to do this. Thanks for your time and assistance.
    John Dickey

    Okay, after doing a lot of research and studying, I am beginning to see a way to make this work. We will have to find a way to test this out in a development environment. It looks like that if I set the catch up element entry percentage amount to NULL (blank), then set the Take Overlimit Catchup value to ALWAYS, then it may work the way that I want it to. If I am reading this right, at the start of the year only the base element percentage will have a calculation done and a deduction taken (let me emphasize that I am talking about a SEQUENTIAL value for the catch up processing field value). In the period that the employee hits the base limiit, the base element percentage will be fully calculated, with the amount in excess assigned to the CATCH UP ELEMENT. The trick here, that I was failing to realize at first, was that the take overlimit amounts always goes to the catchup element. The next week all of the base percentage amount is overflow and goes to the catch up element. You keep adding to the catch up element amount until you hit the catch up limit. There is NEVER a calculation of an catch up element amount, since the percentage is NULL in that element entry. The only element that ever gets an amount calculated for it is the base element. There is a document, document id 733997.1, that gives an explanation and example of how this Take Overlimit Catchup function works. Will see what happens whenever we can get around to testing this out.
    John Dickey

  • How to handle an asynchronized scenario?

    Hi, there:
    I had an asynchronized scenario in my web application. After client side collecting information and click "submit", my servlet in server side is supposed to wrap those information in a transaction and send it to 3rd party engine, however, the response of that transaction from the 3rd party engine is asynchronized (may take several minutes).
    Question:
    At client side, after user click "submit", what should I do?
    a. tell user transaction is submitted successfully, and ask him to check response later;
    b. display some information like "please wait, your transaction is processing ..........", and my servlet keeps polling response, and send html response back after get response from 3rd party?
    c. Or, servlet send response back immediately, however, somehow to get client side keeps sending request to servlet to check the status of transaction?
    Highly appreciated if any suggestion or comments.
    Thanks a lot in advance
    David

    You are waiting
    for card authorization back. How do they handle those
    scenario? like during waiting for response, the
    client navigate to other links, or even shut down the
    browser.You can't do anything about clients who don't wait for a response. You can't even find out that they didn't wait. If your response time is going to be fairly reasonable -- a few seconds, maybe up to 30 seconds -- then displaying scary warnings may persuade the client to wait. If your response time is going to be a minute or more, then you are just going to annoy people. One option in that case is to get the client's e-mail address. Then your servlet would just send a trivial response ("Thank you for your order, you will be notified when it is processed") and put the job in a queue to be handled off-line. Handling of the job would involve sending a confirmation e-mail.
    Or you could provide another page where the user can keep track of the progress of his request, which your off-line system is updating whenever it does something with it.
    Also, for those time consuming tasks in
    serverside, if hundreds of requests come at almost
    the same time, will it cause some problem in server
    side? like performance, resource issue?Sure it could. There are people who do nothing but tune Web servers for a living.

  • Confused about CLASSPATH and how java handles import statements...

    Hello,
    I must admit I don't get it. I read the articles about setting CLASSPATH etc. but I still wonder:
    If you use an import statement, what does the compiler do? I.e. where does it look for the specified classes? I find it confusing because I see in different locations different .jar files:
    C:\jdk1.3.1_03\lib\dt.jar
    C:\jdk1.3.1_03\lib\htmlconvertor.jar
    C:\jdk1.3.1_03\lib\tools.jar
    and also
    C:\jdk1.3.1_03\jre\lib\i18n.jar
    C:\jdk1.3.1_03\jre\lib\rt.jar
    C:\jdk1.3.1_03\jre\lib\jaws.jar
    C:\jdk1.3.1_03\jre\lib\sunrassign.jar
    Can someone explain me what the purpose is of these files?
    And why do I have the same contents in
    C:\Program Files\JavaSoft\JRE\1.3.1_03\lib
    and in
    C:\jdk1.3.1_03\jre\lib
    Why is that?
    Thanks for answering my questions!
    -mike

    Thanx for the answers, but I still wonder, everyone
    here says I need to set the classpath, but I don't.Probably because your classes are already in the class path. The compiler/jvm also look for classes by themselves not just in jar files, when just a directory is supplied in the class path. And a period (".") is a valid directory.
    Programs importing different classes compile with no
    problem. So what's up with that?
    Presumably you are referring to your own code - because they are in the class path.
    Second, I still don't understand why the runtime needs
    the .jar files. The runtime uses classes, like String, that have to come from somewhere.
    This would also mean that end-users
    need to set the classpath to the .jar files in their
    JRE directory to be able to run programs that import
    classes from these .jars. But this is not true, right?No it is true. The end-users will have to set the class path. There are variations on this which make it seem like no class path is set. For instance applets in a browser are java but the end-user does not need to set a class path. That is because the browser knows how to download classes/jars and how to set it up so it uses them. (Actually it uses a class loader, but that is probably more information that you need.)
    Because if I make some nice classes myself and import
    them, how can I expect my end-user to install these
    classes and make a classpath for them?That would be between you and you end-user.
    First installation is not part of java. For installation you will have to find something outside of java to accomplish the goal.
    Additionally how the class path gets set is OS specific. Java does not deal with that. You will also have to find some way to deal with this (most likely part of the installation.)
    There are also variations on this. For example the browser example I gave above. Or using the ext directory. Or creating an executable jar. Or simply setting the class path.
    In my understanding it should only be needed in the JDK, not
    in the JRE. True or am I mistaken?Mistaken. The class path is needed in the JRE as well. You will need to set it.

  • How to Handle Inventory Management Scenarios in BW (NW2004) BW7

    Hello,
    does anybody know if there is a more actual version of the document available?
    Thx,
    Christian

    Hi,
    Before posting please search on Google.
    please find the link.
    SAP BW - Inventory data loading step by step(0IC_C03)
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/906b837a-0d54-2c10-08b8-bde70337547e?overridelayout=t…
    Thanks,
    Phani.

  • How to handle this kind of scenario in SBO

    Hello, I am new to SAP Business One. I would like to know how to handle Transporation Company scenario below in SBO.
    QUESTION 1: A transportation company has 30 truck. The company receives orders from the customer and use the trucks to deliver the goods from Point A to Point B everyday. The cost for delivery is $0.50 per-KG.
    The way I handle above:
    1. In ITEM MASTER DATA:
    Create a new item > Item Type: Labor > Description: Delivery from Point A to Point B > and determine the delivery price is $0.50.
    2. Use the item created in no 1 above when creating Sales order/Invoice.
    If the weight is 5000kg then simply put QTY 5000 in Sales Order with the price of $0.50/KG, which has been set in Item Master Data.
    Is the above method correct or there is better way to handle?
    QUESTION 2: TRACKING EACH TRUCK EXPENSES BY ITS LICENSE PLATE:
    Each truck has Spare Parts expense (e.g. bulbs, oil, battery, tires etc) that the company would like to track.
    The company purchased the spare parts from suppliers and keep it in the warehouse. When a truck needs to replace its spare parts, the company will issue the parts and record it under that truck's license number as that truck's expense.
    The goal is SBO must be able to provide detail monthly expense report for each truck when inquired by its license plate. I prefer NOT to manually input "directly" in Journal Entry to prevent error.
    Thanks.

    Hi,
    welcome to sbo forum!
    For your question 1, it will depend if you will only have 1 route for all of your deliveries.If your point of origin is always point a then destination is point B w/ price of $0.50,then you are right with your process... but if you will have to expand and move into different places, i think it will best for you to create a UDT for your pricing.
    in summary:
    1.create UDT pricing(with origin,destination and price)
    2.Create UDF in row level of Sales order(U_origin,_U_destination)
    3.) create FMs for your Sales order Origin and destination based on UDT Pricing table.
    4.) create automatic fms for your price( based on origin and destination selection).
    for question 2, all your repairs and maintenance will pass through AP invoice( either by item or service). in our country we normally use Ap service,since a truck has normally several types of spare parts. This figures will will surely add up to the number of item master data record in your system ,since you will need create a unique item for each and every item available.
    -To monitor all your expenses, you will need to create a UDF in the header of PO, GRPO or AP invoice, place your plate number here. so that when you extract your reports, you will easily identify your expenses per truck.
    in summary:
    1.create UDF for header of PO,GRPO or AP( Udf_Plate number) you can set valid values for you udf or by FMS with default values.
    2.Create Udf for lines of PO,GRPO or ap(UDF_spare part type) --note: if you will use the Item type document for repairs and  maintenance then i guess you dont need to add UDF_spare parts.
    Hope i was able to help you.
    Regards,
    Darius Gragasin

  • How to handle E1 Purchases & Sales in SAP B1

    Hi all,
    How to handle E1 Purchases and Sales in SAP Business One.
    Kindly advise, if possible provide me the documents.
    Regards,
    Vikram

    Hi Samir,
    I am using 2007B PL - 08
    My customer place the Purchase Order to X Supplier for Excisable Items.
    X supplier place the order to Y.
    Y will directly deliver the goods to my customer with the reference of supplier's X details and also Y will mention the Unit Price and Excise duty paid by him.
    Based on the material delivered by Y,X supplier's send's the Invoice to my customer.
    but in this scenario my customer is eligible to claim the excise duties as per Y supplier.
    How to handle the above scenario.
    Kindly advise.
    Reagdrs,
    Vikram

  • How to handle the master data when we are loading the from multiple clients

    Hi,
    We are loading HR data from two different clients 101 and 102 of same source system.
    Here we are facing the problem with msater data maintenance for employee in BW, whose employee numbers are same.
    For example client 101 employee range is 10001 to 10100.
                      In client 102 also same employee range.Then how to handle the above scenario
    Is there any solutions apart from compounding of infoobjets with logical system.
    Thanks in advance for your sugessions.
    Thanks.
    Maria.

    Hi ,
    you  can create copy of 0EMPLOYEE Object.
    Load one client master data to the copied object.
    Example:
    1. Create ZEMPLOYEE copy of 0EMPLOYEE.
    2. create the transformation or rules
    3.  You have to follow same for remaining objects
    regards,
    HREDDY

  • How to handle the control records in case of file to idoc scenario.

    Hi All,
    can you please clarify me how to handle the control records in case of file to idoc scenario.

    Hi,
    In File to Idoc scenario even though you selected apply control record values from payload and you are not getting those correct values which you have provided in the mapping.
    Also check the checkboxes Take sender from payload and Take receiver from payload along with the Apply control record values from payload checkbox
    Regards
    Seshagiri

  • How to handle the stale cheques in EBRS

    Dear Guru's
    Can any bady explain me how to handle the stale cheque cases in EBRS, and what are the possible transaction codes using for that.
    Any help can be greatly appreciated.
    Regards,
    kishroe

    Hi
    any bady know about this plz respond.
    Thanks in Advance
    kishore

Maybe you are looking for

  • Windows 7 randomly locks up on T60

    I have had this T60 for over a year. It came with a clean install with Windows 7 Professional.  Over the last 3 weeks it has started locking up randomly. Powering off/on seems the only way to bring it back. I've been getting the family to tell we whe

  • [CS4][JS] How to place objects in different layout

    Hi, Currently we are working on the A4 layout size of InDesign documents, after page finalized, those articles is going to publish in both A4 and A3 document. The question is how can we convert the A4 sized document into A3 sized document via java sc

  • Dependant LOV on Search Field

    Hi, I am a newbie using ADF 11g. I am trying to create a Search page which takes 2 parameters. 1st Parameter is the Country LOV 2nd Parameter is the City LOV which is dependant on the 1st Parameter I have done the below steps but no with no positive

  • Help formatting date on the PO_STANDARD_XSLFO.xsl page

    I am using the standard PO_STANDARD_XSLFO.xsl and PO_STANDARD_PO.xsd and I want to format the Promised By and Need By dates to be dd-mmm-yy instead of dd-mmm-yyyy and then a time stamp. How can I accomplish this?

  • Re: Lost Library

    When in a hole dig deeper..... Went to software update and let it roll. As it was doing the 10.4.9 update, it stopped declaring a problem and ever since the mac won't start at all. No blue line appears on the "Mac OS X" window, so no desktop appears.