Same query, different results depending on compute statistics!!!

This one is really weird, you would think I am making this up but I am not...
We have one really long query that uses several large inline views and usually returns a few rows. All of a sudden the query stopped working -- i.e. it returned no rows. We tried rebuilding indexes; this didn't help. We tried computing full statistics and this fixed the problem. Has anyone heard of compute statistics affecting the output of a query????
About a week later, the problem happened again. Computing estimate statistics didn't help. Only computing full statistics fixed the problem.
The only thing I can note, is that this database was recently upgraded from 9.2.0.6 to 9.2.0.7, but I checked the install log files and there are no errors.
Luckily this is just a development database but we are a little worried that it might re-occur in production. We have a few other development databases that have also been upgraded to 9.2.0.7 and none of these have the problem.
We have compared the init.ora files, no real differences. Any other ideas? Maybe a full export import?

Thanks, will do, but I am a little doubtful it is
fixed by 9.2.0.8 because it works on one of our
9.2.0.7 environments... Although if it is a statistics issue, it's likely a corner case, so you have to have a number of things in alignment. It's quite possible that, for example, two systems have identical structures and identical data but slightly different query plans because the data in one table is physically ordered differently on one system than in another which slightly changes the clustering_factor of an index which causes the CBO to use that index on one system and not on another. You may also end up with slightly different statistics because you have histograms on a column in one system and not in another.
Looks like we are going to 9.2.0.8 anyway because of
the end-of-life service support forcing us to go to
9.2.0.8 anyway.If it reproduces on 9.2.0.8 (and I'd tend to suspect it will), it's certainly worth raising an issue. Unless you have an extended support contract, though, I wouldn't hold out a lot of hope for a patch if this isn't already fixed, since 9.2 leaves Premier Support at the end of the month...
Justin

Similar Messages

  • SQL Server 2012 Physical vs. Hyper-V Same Query Different Results

    I have a database that is on physical hardware (16 CPU's, 32GB Ram).
    I have a copy of the database that was attached to a virtual Hyper-V server (16 CPU's, 32GB Ram).
    Both Servers and SQL Servers are identical OS=2008R2 Standard, SQL Server 2012R2 Standard same patch level SP1 CU8.
    Same query run on both servers return same data set, but the time is much different 26 Sec on Physical, 5 minutes on virtual.
    Statistics are identical on both databases, query execution plane is identical on both queries.
    Indices are identical on both databases.
    When I use set statistics IO, I get different results between the two servers.
    One table in particular (366k rows) on physical shows logical reads of 15400, on Hyper-V reports logical reads of 418,000,000 that is four hundred eighteen million for the same table.
    When the query is run on the physical it uses no CPU, when run on the Hyper-V it takes 100% of all 16 processors.
    I have experimented with Maxdop and it does exactly what it should by limiting processors but it doesn't fix the issue.

    A massive difference in logical reads usually hints at differences in the query plan.
    When you compare query plans, it is essential that you look at actual query plans.
    Please note that if your server / Hyper-V supports parallelism (which is almost always nowadays), then you are likely to have two query plans: a parallel and a serial query plan. Of course the actual query plan will make clear which one is used in which
    case.
    To say this again, this is by far the most likely reason for your problem.
    There are other (unlikely) reasons that could be the case here:
    runaway parallel threads or other bugs in the optimizer or engine. Make sure you have installed the latest service pack
    Maybe the slow server (Hyper-V) has extreme fragmentation in the relevant tables
    As mentioned by Erland, you have much much more information about the query and query plan than we do. You already know whether or not parallelism is used, how many threads are being used in it, if you have no, one or several Loop Joins in the query (my
    bet is on at least one, possibly more), etc. etc.
    With the limited information you can share (or choose to share), involving PSS is probably your best course of action.
    Gert-Jan

  • Same query different timings , different sessions at the same time

    I am running exactly the same query from 2 different sessions almost simultaneously and in one session it is taking 2 seconds and in the other it is taking 20 seconds. The explain plans in both the sessions (by set autotrace on) are exactly the same. The timing is almost same for succesive runs of the query in the same sessions. That is when I run the query again in the "slow session" it is always around 20 seconds and when I run the query again in the "fast session" it is always fast. The queries are being run within a few seconds of each other so the load on the database is almost same.
    My hunch is that it is a database parameter that needs to be changed to solve this problem, can someone guide me with this ....which parameters I should ask our DBAs to adjust ? Our database is Oracle 10G.
    Regards
    Amitabha

    Duplicate thread
    Same query different timings , different sessions at the same time
    Gints Plivna
    http://www.gplivna.eu

  • Same infoprovider, different results

    Hello together,
    here it is my problem: I have one infoprovider and two queries based on it. In both queries I have one identical formula, but the result is different ..
    Could you please help me? Where could be the problem?
    Thank you,
    Iuliana

    Please chacek all the InfoObjects in rows and columns in both Queries and Formulas/CKFs/RKFs/ and variavles too....Definetly there will be a difference..so you are getting different results...all calculated kfs in both Queries using same formulas?
    There is no rule that both Queries should display same result if both are on Same infoProvider unless and until both are similar(one Query is copy of another one)...
    i don't think in u r case it is same..
    Please don't forget to assign points if it is helpfulu.its the way of saying thnaks here in SDN.

  • Same query different languange

    Hi All,
    How to maintain same query but with different language i.e English and German. Is there a dictionary to maintain for the translation or is it auto-translate.
    Appreciate any inputs.
    Points for all help.
    Thanks and regard.
    Azlan

    Hi,
    in case you have all headlines.... as variables and you are not using any fixed texts in your query this will be done automatically in case you translated all stuff. Mostly the standard objects are coming with german and english anyway ...
    For the translation use rsa1->goto->translation.
    regards
    Siggi

  • HT4207 Archiving gmail e-mails on MacBook Pro vs iPhone: Same action, different results

    The core issue:
    The same action yields different results.
    The details:
    First, I'm on my laptop looking at an e-mail sent to my gmail account and want to archive it so I hit archive and it goes to the archive folder; Second, I'm on my iPhone looking at an e-mail sent to my gmail account and want to archive it so I hit archive and it goes to the "All Mail" folder in my gmail account. The second part doesn't make me happy because it doesn't make any sense. In other words the same action results in two different results.
    Ideal solution:
    Please tell me how to make the archive icon on my iPhone act like its righteous twin does on my MacBook Pro.
    Thanks!

    Same question, but the reverse. I want Apple Mail on Mountain Lion to work like iOS with regard to archiving Gmail messages.

  • Problem - same report different font, depending on source

    Post Author: smash
    CA Forum: General
    Hi, thanks for any help you can give.
    I have a report that when I print from the crystal designer, it prints exactly like I want it. The report is using a Courier 10cpi font. When I export to pdf or export directly to the printer, the report is printed with an Arial font. I have the courier on the server and the client machines and I am printing to a IBM 6500 feed printer.
    Anyone have a clue on why these might be printing differently?
    Thanks

    Thanks, will do, but I am a little doubtful it is
    fixed by 9.2.0.8 because it works on one of our
    9.2.0.7 environments... Although if it is a statistics issue, it's likely a corner case, so you have to have a number of things in alignment. It's quite possible that, for example, two systems have identical structures and identical data but slightly different query plans because the data in one table is physically ordered differently on one system than in another which slightly changes the clustering_factor of an index which causes the CBO to use that index on one system and not on another. You may also end up with slightly different statistics because you have histograms on a column in one system and not in another.
    Looks like we are going to 9.2.0.8 anyway because of
    the end-of-life service support forcing us to go to
    9.2.0.8 anyway.If it reproduces on 9.2.0.8 (and I'd tend to suspect it will), it's certainly worth raising an issue. Unless you have an extended support contract, though, I wouldn't hold out a lot of hope for a patch if this isn't already fixed, since 9.2 leaves Premier Support at the end of the month...
    Justin

  • Gamestop Red Samurai controller - same controller different result

    I'm using a new Gamestop Red Samurai controller paired via bluetooth to my mac, and it's been working great. I can play a PS1 emulator and map all the keys and it's excellent. So I thought "How about getting some 2 player action going", and I bought another controller (same brand and model number). The new controller will not stay connected to the mac for longer than 5 seconds. The original doesn't disconnect until I manually turn it off. When I bought the new controller I actually bought 2 because a friend also wanted one. I tested his and it's the same issue of 5 seconds, then the connection goes away. I can hit any button on the controller and it will connect again, but in another 5 seconds it's gone. I can manually reconnect via my mac settings, but again in 5 seconds, you can guess what happens. So is there anything I can try to get this new controller to stay connected. I've tried using the controllers gaming mode and keyboard mode (switch on the back) but the connection continues to drop either way. I've removed all previous controllers from my mac bluetooth preferences, but it still will only stay connected to the original controller when I add them back 1 by 1. I'm completely stumped by how 2 out of 3 seemingly identical products could behave so differently. If there were any more in store, I'd go try them out and find another that stays connected, but it's a big gamble to buy online hoping for better luck. I'm open to any possible solutions.
    I'm on Mavericks 10.9.5. I should also mention that both controllers pair with my amazon fire tv stick, and stay connected just fine. The new controller that disconnects from the mac, also stayed paired to a windows computer just fine.

    Hi Matt,
    Just to add a note to the great info from Scott. You can use the WCS to push this info out to all the WLC's using this method;
    Configuring an Access Point Authorization Template
    Follow these steps to add an access point authorization template or make changes to an existing template. These templates are devised for Cisco 11xx/12xx series access points converted from IOS to LWAPP or for 1030 access points connecting in bridge mode.
    Step 1 Choose Configure > Controller Templates.
    Step 2 From the Security selections in the left sidebar menu, choose AP authorization.
    Step 3 If you want to add a new template, choose Add Template from the Select a command drop-down menu and click GO. To make modifications to an existing template, click a MAC address in the AP Base Radio MAC column. The AP Authorization Template appears (see Figure 9-12), and the number of controllers the template is applied to automatically populates.
    Step 4 Select the Import from File check box if you want to import a file containing access point MAC addresses.
    
    Note You can only import a .csv file. Any other file formats are not supported.
    Step 5 Enter the file path from where you want to import the file.
    Step 6 Click Save.
    From this doc;
    http://www.cisco.com/en/US/docs/wireless/wcs/4.0/configuration/guide/wcstemp.html#wp1072945
    Hope this helps!
    Rob

  • Controls and timecode - same player, different result

    I need to look at video clips on-line on a laptop and a PC, both running Windows 7 32 bit and from within Firefox 3.6.3 with Flash 10.   But they behave differently even on the same video from the same site.  On one (the laptop) the visible screen is larger, there is a black border at the bottom with start/pause/stop controls, and a timecode.  On the other (the PC) no border, no controls, no timecode.
    How can this be?  .
    There are minor differences - a few decimal points -  in version numbers for Flash 10 (as well as for firefox itself, java and many other apps) but in all cases the PC is the more current.
    I've checked for differences in plug-ins, add-ons, default programs.  No obvious answer.
    Mybe there is some way of setting options within flash player so that it shows things like timecodes?
    Advice welcome!!!

    Select count(*) from (
    [code0]
    select J_8DG_4JLF.J_8DG_4JLF_DG7.LINE_REF AS "F1" , J_8DG_4JLF.J_8DG_4JLF_DG0.PRIMARY_CARD AS "F2" ,
    ROUND ( SUM(Case when J_8DG_4JLF.J_8DG_4JLF_DG0.LINE_INTERNAL_CODE BETWEEN 40 and 59 THEN 1 ELSE 0 END),0) AS "F3" ,
    ROUND ( SUM(Case when J_8DG_4JLF.J_8DG_4JLF_DG0.LINE_INTERNAL_CODE BETWEEN 40 and 59 THEN - J_8DG_4JLF.J_8DG_4JLF_DG0.LINE_AMT
    ELSE 0 END),0) AS "F4" , Max( J_8DG_4JLF.J_8DG_4JLF_DG0.TXN_DATE) AS "F5"
    , Max( nvl(J_8DG_4JLF.J_8DG_4JLF_DG0.CUSTOMER_STAFF_REF,' ')) AS "F6"
    from J_8DG_4JLF.J_8DG_4JLF_JT
    INNER JOIN J_8DG_4JLF.J_8DG_4JLF_DG7 On J_8DG_4JLF.J_8DG_4JLF_DG7.DG7_ID =J_8DG_4JLF.J_8DG_4JLF_JT.DG7_ID
    INNER JOIN J_8DG_4JLF.J_8DG_4JLF_DG0 On J_8DG_4JLF.J_8DG_4JLF_DG0.DG0_ID =J_8DG_4JLF.J_8DG_4JLF_JT.DG0_ID
    where ((J_8DG_4JLF.J_8DG_4JLF_DG0.LINE_INTERNAL_CODE in('22','42')) )
    group by J_8DG_4JLF.J_8DG_4JLF_DG7.LINE_REF, J_8DG_4JLF.J_8DG_4JLF_DG0.PRIMARY_CARD
    having (
    ROUND ( SUM(Case when J_8DG_4JLF.J_8DG_4JLF_DG0.LINE_INTERNAL_CODE BETWEEN 40 and 59 THEN 1 ELSE 0 END),0) > 0
    AND
    ROUND ( SUM(Case when J_8DG_4JLF.J_8DG_4JLF_DG0.LINE_INTERNAL_CODE BETWEEN 20 and 39 THEN 1 ELSE 0 END),0) = 0
    [code0]
    ) t
    LINE_INTERNAL_CODE is string

  • Same PDF, same printer, different results from different PCs??

    Weird situation I've encountered:
    I have a PDF that yields fuzzy, slightly bolder black text when printed from a couple different PCs, but prints just fine (no fuzzy black text) from other PCs-- even when the PDF is printed to the same printer.
    Any ideas why a given PC can't print the PDF text cleanly? Every other non-black text, logos,and lines print just fine -- but black text can end up looking like a little bit of mascara was applied to it.
    Thanks in advance.
    pete

    Are the same printer drivers used on each workstation? Some printers can use
    both PCL and PostScript drivers. Some drivers may also be set to download
    fonts to the printer while the others may allow font substitution by the pri
    nter..

  • Same code, different result

    I have been using Javascript to create popups in Creator using the onclick property of a button or hyperlink.
    Today any popups created fail with the message:
    HTTP Status 500 -
    type Exception report
    message description The server encountered an internal error () that prevented it from fulfilling this request.
    exception javax.servlet.ServletException: Cannot find FacesContext
    Strangely the popups created earlier still work OK.
    How can Creator cause code that works in older pages not work when cut and pasted into new pages?
    After all the Javascript is standard stuff widely used across the web.
    In the <head> tag I have
    <script Language="JavaScript1.2">
                    function popup(url, name, left, top, width, height)
                    settings=
                    "toolbar=no,location=no,directories=no,"+
                    "status=no,menubar=no,scrollbars=yes,"+
                    "left="+left+",top="+top+","+
                    "resizable=yes,width="+width+",height="+height;
                    MyNewWindow=window.open(url,name,settings);
                    MyNewWindow.focus();
                </script>          and in the link the code is
    <h:outputLink binding="#{yayw$yayw13Content.yw13hyperlink6}" id="yw13hyperlink6"
                    onclick="popup('AidPopup.jsp', 'WinKC6', 150, 250, 600, 200); return false;" styleClass="tabProps">
                    <h:outputText binding="#{yayw$yayw13Content.ywhyperlink6Text}" id="ywhyperlink6Text" styleClass="cmdLnk" value="#{c.w130}"/>
                </h:outputLink>where AidPopup.jsp is the jsp page tp pop up when called by the link.
    The calling page and the popup page are in the same folder.
    Thanks for any advice on this problem.
    John.

    It turns out the solution is that the full path to the popup file has to be given for the URL. So in the example above the code for the link should be
    <h:outputLink binding="#{exer$exer1Content.hyperlink1}" id="hyperlink1" onclick="popup('/attain/faces/exer/RefocusPop.jsp', 'WinRef', 150, 250, 600, 200); return false;">
       <h:outputText binding="#{exer$exer1Content.hyperlink1Text}" id="hyperlink1Text" value="#{es.ex1}"/>
    </h:outputLink>The project name is Attain and exer is a sub-directory containing the calling page and the RefocusPop.jsp.
    I'll leave it to someone at Sun to explain the mystery of why pages written up to a few days ago still work on the old code but new pages must use a full path for them to work.
    John.

  • Same loop, different result

    The function below contains two virtually identical for..in
    loops. The first one produces the expected result, the second one
    only returns the last value of the object.
    Output:
    first loop
    0 => [object LED]
    1 => [object Math_Add]
    2 => [object Math_Multiply]
    second loop
    2 => [object Math_Multiply]
    I can't even see how this is possible. I'm at the pulling my
    hair out stage. I must be doing something very wrong somewhere, but
    I can't see it.

    I think it's time to stop working for me. I had been looking
    at that for hours. I had even managed to make the other loop do
    what I wanted to do, but I still couldn't tell why. Now I
    feel...humbled, as I should be.
    You are my hero. Thanks.

  • Query changing results depending on the display of a breakdown

    Hello folks,
    we have got a query that shows the following strange behaviour:
    - I execute a query that shows wrong additions.
    - if I add a breakdown the additions are correct.
    - if I remove the breakdown again additions still are correct.
    The problem could be derived from correction-bookings in SEM-BCS that were made partner-profit-centers that no longer exist for this company.
    We know, that these bookings cause the error (ie the difference in the addition)
    But what is strange is that the system is adding up wrong at first and correct afterwards.
    We already checked
    0-supressing
    direction of calculation
    possible filters (no filters are set at this query)
    Has anyone a hint what could be the cause for this problem?
    Thx a lot,
    Thomas

    Hi Navesh,
    there are no cell-definitions in the query.
    thx,
    Thomas

  • 2 instances,same box,different results while trying to create a TDE wallet

    The command I'm executing is:
    alter system set encryption key authenticated by "xxx";
    There are 2 instances, using the same Oracle home. 1 instance can create a wallet, another yields ORA-28353: failed to open wallet.
    I modified sqlnet.ora file to alter the path for the wallet
    ENCRYPTION_WALLET_LOCATION =
    (SOURCE=
    (METHOD=file)
    (METHOD_DATA=
    (DIRECTORY=/wallets)))
    The first instance creates a wallet there, the second doesn't.
    I looked up the v$parameters view - instances seem to be almost identical in their setup.
    What else could be causing such a strange failure?

    Oracle version = 10.2.0.3
    There is the directory /wallets (777 permissions), otherwise the first instance couldn't successfully create a wallet there.
    I fail to understand why the first instance is able to generate the wallet, and the second is not.
    Also, if I create the wallet using instance 1, instance 2 still can't open it.
    alter system set encryption wallet open authenticated by "xxx";ORA-28353: failed to open wallet
    I can't create a wallet in the standard directory either, even though the directory exists.
    ${ORACLE_BASE}/admin/${ORACLE_SID}/wallet

  • Exporting 2 videos, same style, same options, different results

    Hello everyone,
    I'm currently working on a 2 part video. I have all the same options in Preferences and in the Export Media options, but I am getting issues with the text that appears. Can anyone give me insight?
    I've tried checking the "Use max render quality" box and am using the "YouTube 1080p 29.97" Preset.
    See attached examples. "a" is the first video and the text looks muddy. "b" is the second video, with same options, but looks much clearer.
    Thanks

    A looks like a field issue.  Look into that.

Maybe you are looking for