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.

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 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.

  • 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.

  • 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 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

  • 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.

  • Same image, same code, different results!!

    Hi,
    I have this HUGE dilema, the following works with a gif or a jpg image but the problem occurs in png images (the format I have chosen to create my images in).
    Here is the source code for the applet:
    * bufferstr.java
    * Created on 23 October 2003, 14:03
    * @author  Ahmed
    package Destruction_BufferStrategy;
    import java.awt.*;
    import java.awt.image.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class appletExecutor extends JApplet {
        private Image offs;
        private Graphics2D g2;
        ImageLoader imageStore;
        Game game;
        public void init() {
            imageStore = new AppletImageLoader();
            imageStore.prepareImage("car2dirty1.PNG");
            imageStore.prepareImage("car2dirty2.PNG");
            imageStore.prepareImage("car2dirty3.PNG");
            imageStore.prepareImage("car2dirty4.PNG");
            imageStore.prepareImage("car2dirty5.PNG");
            game = new Game(imageStore, this.getSize().width, this.getSize().height);
            super.getContentPane().add(game);
            game.startThread();
            game.createStrategy();
            game.requestFocus();
    }and here is the code for the application:
    * appExecutor.java
    * Created on 25 October 2003, 01:08
    package Destruction_BufferStrategy;
    * @author  Ahmed
    import java.awt.*;
    import java.awt.image.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class appExecutor extends JFrame {
        private Image offs;
        private Graphics2D g2;
        ImageLoader imageStore;
        Game game;
        public appExecutor() {
            super("Destruction Derby");
            setDefaultCloseOperation(super.EXIT_ON_CLOSE);
            setResizable(false);
            setBounds(0, 0, 600, 600);
            imageStore = new AppletImageLoader();
            imageStore.prepareImage("car2dirty1.PNG");
            imageStore.prepareImage("car2dirty2.PNG");
            imageStore.prepareImage("car2dirty3.PNG");
            imageStore.prepareImage("car2dirty4.PNG");
            imageStore.prepareImage("car2dirty5.PNG");
            game = new Game(imageStore, 600, 600);
            getContentPane().add(game);
            show();
            game.startThread();
            game.createStrategy();
        public static void main(String[] args) {
            new appExecutor();
    }if I use a jpg or a gif image, everything is as good as gold. However, when I use png images, this error occurs in the applet only:
    java.util.zip.ZipException: invalid stored block lengths
    at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:140)
    at java.io.BufferedInputStream.fill(BufferedInputStream.java:183)
    at java.io.BufferedInputStream.read(BufferedInputStream.java:201)
    at java.io.FilterInputStream.read(FilterInputStream.java:66)
    at com.sun.imageio.plugins.png.PNGImageReader.decodePass(PNGImageReader.java:1165)
    at com.sun.imageio.plugins.png.PNGImageReader.decodeImage(PNGImageReader.java:1276)
    at com.sun.imageio.plugins.png.PNGImageReader.readImage(PNGImageReader.java:1362)
    at com.sun.imageio.plugins.png.PNGImageReader.read(PNGImageReader.java:1530)
    at javax.imageio.ImageIO.read(ImageIO.java:1384)
    at javax.imageio.ImageIO.read(ImageIO.java:1348)
    at Destruction_BufferStrategy.AppletImageLoader.loadImage(AppletImageLoader.java:36)
    at Destruction_BufferStrategy.AppletImageLoader.prepareImage(AppletImageLoader.java:45)
    at Destruction_BufferStrategy.appletExecutor.init(appletExecutor.java:28)
    at sun.applet.AppletPanel.run(AppletPanel.java:347)
    at java.lang.Thread.run(Thread.java:536)
    Error Loading Image: car2dirty1.png
    the Error Loading Image: car2dirty1.png is from my Loading Images class which abuse so kindly showed me the light to.
    any help on this issue is of great appreciatence..
    P.S. the error occurs for every image, not just this one!!

    You don't actually show the method you are using to load your image, however from the error msg, I assume you are using ImageIO.read().
    What version of JRE are you using?
    The reason I ask, is because the error you are getting seems to be occuring at quite low-level; the only potencial cause I know of (outside an error of your creation) is the ImageIO loader in 1.4.0 is buggy/broken when dealing with small images.

  • Same code, different result (load the library...)

    I have to use external library. So I programmed short code. But...
    It's work in Illustrator CS3
    var samplelib= 'C:/Program Files (x86)/Adobe/Adobe Bridge CS3/webaccesslib.dll';
    mylib = new ExternalObject ("lib:" + samplelib);
    alert(mylib.version) ;
    It's NOT WORK in Illustrator CS5
    var samplelib= 'C:/Program Files (x86)/Adobe/Adobe Bridge CS5/webaccesslib.dll';
    mylib = new ExternalObject ("lib:" + samplelib);
    alert(mylib.version) ;
    Extend Script Toolkit talk to me : 'I/O error'(i uploded capture image below)
    I don't know what I missed. Could you let me know what I wrong?
    Thank you for reading.
    p.s. I'm using windows7.

    Hi kimDino8,
    Can you check the file path again?
    In my opinion the path should be (sorry, I can't check this here at home - perhaps this is the path for CS5.5):
    var samplelib= 'C:/Program Files (x86)/Adobe/Adobe Bridge CS5.1/webaccesslib.dll';

  • Strange query plans, and so different results from a view.

    In my database (11g), I have a currency exchange rate table, which contains all currencies and their exchange rate to USD. I need to have a number of different exchange rates - To GBP, EUR, etc...
    To accomplish this I have created a view, which has one union statement of all the USD exchange rates, with the same data joined back on itself to give the exchange rates based on their exchange rate to USD - ie: SELECT b1.Date, b1.Currency AS FromCurrency, b2.Currency as ToCurrency, b1.Rate/b2.Rate as Exchange Rate FROM Rates b1, Rates b2 on b1.Date = b2.Date
    This view works fine when I query it, and returns the data as I expect.
    I have a second view that is joined to this view to give a return of the amount in each currency for reporting. This view seems to work correctly when I narrow down the search requirements and have a small set of data.
    The issue I am having is when I query the second view and get it to return all the data. Instead of receiving 4 rows per transaction (I am only interested in 4 exchange rates for display) I typically receive up to 2 rows. The first record is for the conversion to USD, the second record is for the conversion to the supplied currency. The issue is that this exchange rate actually includes the aggregate for all 3 other requested currencies (not the USD).
    So instead of getting something like:
    Amt RC BC (Amt = Amount, RC = Reporting Currency. BC = Base Currency)
    60 GBP GBP
    80 EUR GBP
    100 USD GBP
    1000 ZAR GBP
    60 GBP USD
    80 EUR USD
    100 USD USD
    1000 ZAR USD
    I get the following set of results:
    1140 GBP GBP
    100 USD GBP
    100 USD USD
    Has anyone come accross something similar or have any ideas on how I can resolve this?
    Thanks
    PS: I can get both sets of results from the same view depending on the filter criteria. Also if I convert the exchange rates into a table, it then returns the correct results as expected.

    943081 wrote:
    The idea is to seek help in solving the problem. I was hoping that perhaps someone had experienced the same thing - different results for "effectively" the same query:Well, that's the issue... without additional info, it's not clear what issue you were seeing.
    SELECT * FROM view WHERE Date = '01 January, 2012'
    verse
    SELECT * FROM view WHERE Date > '31 December, 2011' ORDER BY DateNow it's a bit clearer. That second query is not "effectively" the same as the first query. If the date column is in DATE format, then you ought to have a to_date() around the date string to explicitly convert it into a date so you can do date-to-date comparisons correctly. Also, DATE datatype stores times as well as dates, so asking for data matching midnight of a specific date is different than asking for data greater than midnight of the previous day.
    If the date string is a string, then ... well, the string "31 December 2011" is greater than the string "31 August 2013", despite it being an earlier date. This is why making sure you're using the right datatype for the job is important - a date is different to a string that just happens to contain a date.
    DateID
    I have no objection to using a Date but always struggle to understand what someone means when they tell me "06/07/2012" - granted if the day is above 12 or the same day and month I don't have a problem - but it still leaves 121 days a year that are confusing. sure, but just because you find outputting the display (or rather, someone else's output) confusing doesn't mean you still shouldn't use the correct datatype. Store things as a date, and you can then output it in whatever format you like. Try doing that with a string or a number.
    Don't say it doesn't happen as I got a birthday card from a company in May this year when I have specifically entered my date of birth as being the 5 of a month (name drop down box on their website)!Just because someone else doesn't understand how to work with dates correctly doesn't mean you can't! It's not exactly rocket science, after all!*{;-)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Different results for same query on different servers

    1. database being converted from 7.3.4 to 9.2
    2. query is executed on both servers
    3. different results!
    The tables and data are the same, and indexes are setup on new server. EXPLAIN PLAN was run on both but with (predictably) widely different results.
    I know, not much detail here, but has anyone ever ran into anything like this?
    Thanks,
    Pat

    Folks,
    Here is the relevant information for this problem. The attributes have been changed for confidentiality. If you need any other information let me know.
    Thanks,
    Pat
    Query:
    SELECT
    one,two,three,four,a.five,six,seven,
    a.eight,a.nine,
    to_char(ten,'99999.99'),to_char(eleven,'99999.99'),
    to_char(twelve,'99999.99'),to_char(thirteen,'99999.99'),
    fourteen,fifteen,sixteen,seventeen,eighteen,
    nineteen,twenty,twentyone
    FROM
    table1 a,
    table2 b
    WHERE
    a.five = b.five
    AND one = 'X'
    AND six = ' '
    AND three != 12345
    AND three IN
    (SELECT DISTINCT
    three
    FROM table3
    WHERE
    one = 'X'
    AND twentytwo = 'XYZ'
    AND twentythree != 0
    AND twentyfour != 0
    AND twentyfive = 'Y'
    AND (a.five IN
    (SELECT DISTINCT
    five
    FROM table1
    WHERE
    one = 'X'
    AND three IN (12345)
    Table1:
    one          varchar2(1)     not null     PK
    two          varchar2(20)     not null     PK
    three          number(5)     not null     PK
    four          number(2)     not null     PK
    five          number(6)     not null     PK
    six          varchar2(4)     not null     PK
    seven          number(4)     not null
    eight          varchar2(8)     not null
    nine          date          not null
    ten          number(7,2)
    eleven     number(7,2)
    twelve     number(7,2)
    thirteen     number(7,2)
    Table2:
    five          number(6)     not null     PK
    fourteen     varchar2(5)     not null
    fifteen     varchar2(5)     not null
    sixteen     varchar2(2)     not null
    seventeen     varchar2(35)     not null
    eighteen     varchar2(4)     not null
    nineteen     varchar2(2)
    twenty     varchar2(1)
    twentyone     number(6)
    Table3:
    one          varchar2(1)     not null     PK
    twentytwo     varchar2(12)     not null     PK
    two          varchar2(20)     not null     PK
    three          number(5)     not null     PK
    four          number(2)     not null     PK
    twentysix     number(2)     not null     PK
    twentyfive     varchar2(1)     not null
    nine          date          not null
    twentythree     number(13,8)     not null
    twentyfour     number(12,8)     not null
    twentyseven     varchar2(1)     not null
    eight          varchar2(8)     not null
    Explain - Oracle9i (default, with CBO):
    SELECT STATEMENT
    RECURSIVE EXECUTION SYS_LE_3_0
    RECURSIVE EXECUTION SYS_LE_3_1
    TEMP TABLE TRANSFORMATION
    HASH JOIN
    HASH JOIN
    HASH JOIN
    TABLE ACCESS FULL SYS_TEMP_0FD9D6603_AB874A
    TABLE ACCESS BY INDEX ROWID TABLE1
    BITMAP CONVERSION TO ROWIDS
    BITMAP AND
    BITMAP MERGE
    BITMAP KEY ITERATION
    TABLE ACCESS FULL SYS_TEMP_0FD9D6603_AB874A
    BITMAP CONVERSION FROM ROWIDS
    INDEX RANGE SCAN TABLE1INDEX03
    BITMAP MERGE
    BITMAP KEY ITERATION
    TABLE ACCESS FULL SYS_TEMP_0FD9D6602_AB874A
    BITMAP CONVERSION FROM ROWIDS
    INDEX RANGE SCAN TABLE1INDEX04
    TABLE ACCESS FULL SYS_TEMP_0FD9D6602_AB874A
    TABLE ACCESS FULL TABLE2
    Query results - Oracle9i (with CBO):
    X|A | 1| 0| 22| | 1|08-MAR-02|XYZ | | 24.00| | |ABCDE|FGHIJ|AB|ABCDEFG |ABC | | | |
    X|B | 2| 1| 22| | 7|04-DEC-01|XYZ | | 3.25| 8.00| |ABCDE|FGHIJ|AB|ABCDEFG |ABC | | | |
    X|C | 3| 1| 22| | 1|14-AUG-02|XYZ | | 10.35| | |ABCDE|FGHIJ|AB|ABCDEFG |ABC | | | |
    X|D | 4| 1| 22| | 6|11-JUL-02|XYZ | | .00| 13.90| |ABCDE|FGHIJ|AB|ABCDEFG |ABC | | | |
    X|E | 5| 5| 23| | 1|22-FEB-01|XYZ | | 211.80| | |ABCDE|EFGHI|AB|HIJKLMN |DEF | | | |
    X|E | 5| 5| 23| | 1|22-FEB-01|XYZ | | 211.80| | |ABCDE|EFGHI|AB|HIJKLMN |DEF | | | |
    X|E | 5| 5| 23| | 1|22-FEB-01|XYZ | | 211.80| | |ABCDE|EFGHI|AB|HIJKLMN |DEF | | | |
    X|E | 5| 5| 23| | 1|22-FEB-01|XYZ | | 211.80| | |ABCDE|EFGHI|AB|HIJKLMN |DEF | | | |
    X|E | 5| 5| 23| | 1|22-FEB-01|XYZ | | 211.80| | |ABCDE|EFGHI|AB|HIJKLMN |DEF | | | |
    (approximately 4550 rows returned)
    Explain - Oracle9i (ALTER SESSION SET OPTIMIZER_METHOD=RULE;):
    SELECT STATEMENT
    MERGE JOIN
    SORT JOIN
    NESTED LOOPS
    NESTED LOOPS
    VIEW VW_NSO_1
    SORT UNIQUE
    TABLE ACCESS BY INDEX ROWID TABLE3
    INDEX RANGE SCAN TABLE3INDEXPK
    TABLE ACCESS BY INDEX ROWID TABLE1
    INDEX RANGE SCAN TABLE1INDEX03
    TABLE ACCESS BY INDEX ROWID TABLE2
    INDEX UNIQUE SCAN TABLE2INDEXPK
    SORT JOIN
    VIEW VW_NSO_2
    SORT UNIQUE
    TABLE ACCESS BY INDEX ROWID TABLE1
    INDEX RANGE SCAN TABLE1INDEX03
    Explain - Oracle 7.3.4:
    SELECT STATEMENT
    MERGE JOIN
    SORT JOIN
    NESTED LOOPS
    NESTED LOOPS
    VIEW
    SORT UNIQUE
    TABLE ACCESS BY ROWID TABLE3
    INDEX RANGE SCAN TABLE3INDEX03
    TABLE ACCESS BY ROWID TABLE1
    INDEX RANGE SCAN TABLE1INDEX03
    TABLE ACCESS BY ROWID TABLE2
    INDEX UNIQUE SCAN TABLE2INDEXPK
    SORT JOIN
    VIEW
    SORT UNIQUE
    TABLE ACCESS BY ROWID TABLE1
    INDEX RANGE SCAN TABLE1INDEX03
    Query results - Oracle 7.3.4:
    X|A | 1| 0| 22| | 1|08-MAR-02|XYZ | | 24.00| | |ABCDE|FGHIJ|AB|ABCDEFG |ABC | | | |
    X|B | 2| 1| 22| | 7|04-DEC-01|XYZ | | 3.25| 8.00| |ABCDE|FGHIJ|AB|ABCDEFG |ABC | | | |
    X|C | 3| 1| 22| | 1|14-AUG-02|XYZ | | 10.35| | |ABCDE|FGHIJ|AB|ABCDEFG |ABC | | | |
    X|D | 4| 1| 22| | 6|11-JUL-02|XYZ | | .00| 13.90| |ABCDE|FGHIJ|AB|ABCDEFG |ABC | | | |
    X|E | 5| 5| 23| | 1|22-FEB-01|XYZ | | 211.80| | |ABCDE|EFGHI|AB|HIJKLMN |DEF | | | |
    (approximately 1150 rows returned)
    Indexes (used):
    TABLE1INDEX03     (three)
    TABLE1INDEX04     (five)
    TABLE2INDEXPK     (five)
    TABLE3INDEXPK     (one,twentytwo,two,three,four,twentysix)
    Discussion:
    Notice the repeating result for X,E,5,5,23,.... in the Oracle9i retrieval using CBO.
    The execution of this query returned approximately four times the number of rows as
    Oracle 7.3.4 using RBO. This is a function of how many "fours" there are in table3
    that have matching "threes and fours" in table1. If you put a DISTINCT clause at the
    very front of the query (SELECT DISTINCT one,two,three ....) then the result is
    accurate and the same as Oracle 7.3.4. In one execution of this query, 27,000 rows
    are expected to be returned, but the server returned over 1 million rows!
    When RBO was used on Oracle9i, the results were identical to the ones on Oracle 7.3.4.

Maybe you are looking for

  • Can no longer Play DVD's or Burn Disks in on Macmini

    Hi, I have recently rebuilt my MacMini with a new WD500 Gb hard drive with Snow Leopard and that went fine. One issue that maybe related is that I can no longer play DVD's or burn items to DVD. I have had a look in system profiler and can see the Pio

  • Why does Netflix freeze my new Macbook Pro?

    About a week after getting my new macbook pro I was watching Netflix and the episode froze in one spot and I kept hearing a faultering sound. I couldn't open the Task Manager equivalent and couldn't escape so I had to force shut off my computer. Now

  • I need to know what software to download

    I have the Blackberry Curve and tried to use the disk from the original package from ATT but it wasn't great.  The guy at the ATT store told me it is better to download a desktop manager from the Blackberry site but I don't know which one I should do

  • I have a Canon Vixia HV30 camera and can't get Final Cut Pro x to recognize it. Any suggestions?

    How can I get Final Cut ProX to recognize my Canon Vixia HV30 camera?

  • Anchor Labels

    I am looking for the best way/additional resources to link from one .swf to another .swf but I am interested in targeting a specific movie clip on the main time-line. Are anchor labels the way to go?