Explain and autotrace gave different plans

Hi, while exploring or characteristic expansion, I found explain plan and autotrace gave to different execute plans for the same sql.

It seems to explain taking into account as much as autotrace. So, how these two tools made their decisions, that one is more accurate?

Step 1:

SQL > create table t select * from object;

Step 2:

SQL > EXPLAIN the PLAN FOR
2 Select * from t where owner = 'FOO' or status = 'BAR ';
He explained.
SQL > SELECT * FROM table (DBMS_XPLAN. DISPLAY);
Hash value of plan: 1601196873
------------------------------------------------------------------------------------------------------------------
| ID | Operation | Name | Lines | Bytes | Cost (% CPU). Time |
------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT |          | 302K |    45 M |  1199 (3) | 00:00:15 |

|*  1 |  TABLE ACCESS FULL | T       | 302K |    45 M |  1199 (3) | 00:00:15 |

----------------------------------------------------------------------------------------------------------------

Information of predicates (identified by the operation identity card):

---------------------------------------------------

1 - filter ("OWNER" = 'STATUS"= 'VALID' OR'FUSION_PORTLET ')

Note

-----

-dynamic sample used for this survey (level = 2)

17 selected lines.

Step 3:

SQL > set autotrace on
SQL > select * from t where owner = 'FOO' or status = 'BAR '.
no selected line
Execution plan
----------------------------------------------------------
Hash value of plan: 1162562427
-------------------------------------------------------------------------------------
SQL > select * from t where owner = 'FOO' or status = 'BAR '.
2;
no selected line
Execution plan
----------------------------------------------------------
Hash value of plan: 1162562427

-------------------------------------------------------------------------------------------

| ID | Operation | Name | Lines | Bytes | Cost (% CPU). Time |

-------------------------------------------------------------------------------------------

|   0 | SELECT STATEMENT |            |  2992.   461K |   421 (1) | 00:00:06 |

|   1.  CONCATENATION.            |       |       |            |          |

|   2.   TABLE ACCESS BY INDEX ROWID | T          |     1.   158.   379 (0) | 00:00:05 |

|*  3 |    INDEX RANGE SCAN | STATUS_IDX |  1414 |       |   361 (0) | 00:00:05 |

|*  4 |   TABLE ACCESS BY INDEX ROWID | T          |  2991 |   461K |    41 (0) | 00:00:01 |

|*  5 |    INDEX RANGE SCAN | OWNER_IDX |  1414 |       |    11 (0) | 00:00:01 |

-------------------------------------------------------------------------------------------

Information of predicates (identified by the operation identity card):
---------------------------------------------------
3 - access ("STATUS" = 'FOO')
4 - filter (LNNVL ("STATUS" = 'FOO'))
5 - access ("OWNER" = 'BAR')
Note
-----
-dynamic sample used for this survey (level = 2)
Statistics
----------------------------------------------------------
19 recursive calls
0 db block Gets
508 compliant Gets
0 physical reads
0 redo size
1343 bytes sent via SQL * Net to client
508 bytes received via SQL * Net from client
1 SQL * Net back and forth to and from the client
0 sorts (memory)
0 sorts (disk)

You deceive us & maybe even yourself.

INDEX do not spontaneously come into existence.

You did the INDICES between the first & second EXPLANATION; This is why they are different.

Tags: Database

Similar Questions

  • How can I 'include' a file different php depending on time? Work on a 'Happening Now' page for an event and the need to plan a different content to load as the day continues. Thank you!

    Work on a 'Happening Now' page for an event and the need to plan a different content to load as the day continues. Thank you!

    The event has class sessions all day (3 days). I would like the page happening now to show what classes are going on right now and what is coming up next. I was hoping just to separate configuration files and load them when necessary, but open to all suggestions.

    PHP has a powerful set of date and time functions.

    To do this is to create a DateTime object and then use conditional logic to include the files you want. A better way would be to keep the details in a database and use the time to retrieve and display the details you want.

    A DateTime object using:

    $now = new DateTime();

    $hour = $now-> format ('G'); This gives you time to the 24 hour clock.

    If ($hour == 13) {}

    It is between 13:00 and 14:00

    } else if ($hour == 14) {}

    It is between 14:00 and 15:00

    } ....

  • xdg-open does not take into account the url and opens the different website when Firefox is the default browser in Ubuntu

    I am running Ubuntu 14.04 64 bit with Firefox version 38 for Ubuntu
    It is complected, and I tried to explain everything clearly.

    Today, I noticed a strange behavior.
    I have several URL saved as .desktop files.

    I use webupd8.org as example.
    The code for the exec in the desktop file is:
    Code:

    Exec=xdg-open http://www.webupd8.org/
    

    Today, I noticed that if I try to go to webupd8.org, or most of the other sites, by launching the .desktop file for this site, or by typing the url
    Code:

    http://www.WebUpd8.org/

    in the dashboard Firefox opens to a completely different site. The site that opens is a site that I set up for my children's grandparents to watch videos and see photos of the children. This Web site opens each time. I'm not be directed to a site at random each time. This is the case when I try to visit the webupd8.org OR one of several websites using .desktop file or enter the url you want in the dashboard. Whenever I went to my own domain.

    It happens that I have also several sites registered in a reminder in the Firefox icon in the Launcher sidebar thing in Ubuntu.
    In the case of the beast, the exec code is slightly different and it still responds as it should. In this case, I have:
    Code:

    Exec = firefox-new-tab http://www.webupd8.org/

    Also, if I change my default in opera browser, for example as .desktop files and entering the url directly in the dashboard work as it should.

    To recap:

    When Firefox is the default browser, enter a url in the dashboard or use a to surf to a desired site .desktop file causes my be redirected to my own domain name (which is hosted remotely and not on this computer).

    If, however, I change the Exec command in the .desktop file
    Code:

    Exec=xdg-open <url>
    

    TO
    Code:

    Exec = firefox-new-tab < url >

    the .desktop file will open Firefox and go to the desired site.

    If I change the browser by default Firefox to another browser, everything works as it should and has always so far. That is, with the Opera for example, both
    Code:

    Exec=xdg-open <url>
    

    and
    Code:

    Exec = firefox-new-tab < url >

    result in the browser by opening and going on the planned site. Typed a url in the dashboard is not a problem if the default browser is not Firefox.

    Anyone seen this before? If so, how to solve it?

    Thank you very much for your answers!
    I checked the url of the home page in Firefox and it has been set at startpage.com, but then when I looked at the default programs in Ubuntu, I noticed that the default program for the web had been unintentionally configured to use a .desktop file that leads to t he admin for my Web site login page.

    I changed this back to Firefox and the problem was solved.

  • approach two similar but very different plan?

    I have two similar sql one I 100 ID sample counting from the max (id) of a table. and then I'll copy and paste that in (...) clause

    And the other is I would use an inline clause. They have very different plan and a single traumatic passage slower. You guys can help explain why?

    Quick version:

    SELECT DATA_FILE_EVENT. EVENT_DETAIL,

    DATA_FILE_EVENT. TOTAL_ITEMS,

    DATA_FILE_EVENT_LIST. DATA_FILE_LOG_ID,

    DATA_FILE_EVENT_LIST. ERROR_LIST,

    DATA_FILE_EVENT_LIST. WARNING_LIST,

    DATA_FILE_EVENT_LIST. LOADING_DISPOSITION,

    EVENT. EVENT_CODE,

    EVENT. DESCRIPTION

    OF (YMS. DATA_FILE_EVENT DATA_FILE_EVENT

    JOIN IN-HOUSE

    YMS. EVENT EVENT

    ON (DATA_FILE_EVENT. EVENT_CODE = EVENT. EVENT_CODE))

    RIGHT OUTER JOIN

    YMS. DATA_FILE_EVENT_LIST DATA_FILE_EVENT_LIST

    ON (DATA_FILE_EVENT_LIST. DATA_FILE_LOG_ID =

    DATA_FILE_EVENT. DATA_FILE_LOG_ID)

    en)

    45960479,

    45960480,

    45960481,

    45960482,

    45960483,

    45960484,

    45960485,

    45960486,

    45960487,

    45960488

    )



    slow version:


    SELECT DATA_FILE_EVENT. EVENT_DETAIL,

    DATA_FILE_EVENT. TOTAL_ITEMS,

    DATA_FILE_EVENT_LIST. DATA_FILE_LOG_ID,

    DATA_FILE_EVENT_LIST. ERROR_LIST,

    DATA_FILE_EVENT_LIST. WARNING_LIST,

    DATA_FILE_EVENT_LIST. LOADING_DISPOSITION,

    EVENT. EVENT_CODE,

    EVENT. DESCRIPTION

    OF (YMS. DATA_FILE_EVENT DATA_FILE_EVENT

    JOIN IN-HOUSE

    YMS. EVENT EVENT

    ON (DATA_FILE_EVENT. EVENT_CODE = EVENT. EVENT_CODE))

    RIGHT OUTER JOIN

    YMS. DATA_FILE_EVENT_LIST DATA_FILE_EVENT_LIST

    ON (DATA_FILE_EVENT_LIST. DATA_FILE_LOG_ID =

    DATA_FILE_EVENT. DATA_FILE_LOG_ID)

    where data_file_event.data_file_log_id-= 44793729

    en)

    Select

    rownum + x1.upx sample_log_id

    Of

    (

    Select upx-100 max (data_file_log_id) of data_file_log

    ) x 1

    connect by level < = 10

    )



    I joined the plan explan in jpeg I am using Toad.

    Thank you.fast_sample_event_plan.JPGslow_sample_event_plan.JPG

    Performance differ, due to the change of plan...!

    In a bad series,

    FTS (step 11 - hash for two tables join) happens with Nestep loops (step 12).

    I have e for each record of the return of major steps...

    estimation of cardinaliy steps is only 1...

    Where oracle observe as main steps returns records only 1, hash join operation will be done only once.

    but this is not the case...

    observe the same behavior for under sql also...

    select rownum from dual connect by rownum < 1000;
    select level from dual connect by level < 1000;
    
    -----------------------------------------------------------------------------
    | Id  | Operation                    | Name | Rows  | Cost (%CPU)| Time    |
    -----------------------------------------------------------------------------
    |  0 | SELECT STATEMENT            |      |      |    2 (100)|          |
    |  1 |  CONNECT BY WITHOUT FILTERING|      |      |            |          |
    |  2 |  FAST DUAL                  |      |    1 |    2  (0)| 00:00:01 |
    -----------------------------------------------------------------------------
    

    Although the back lines are 999 but cardinality is 1.

    No provision of cardinality for only connect by clause...!

    Similar SQL as yours...

    select  rownum + max_c sample_log_id
                                From
                                (Select Max(Empno) Max_C From Emp)
                                connect by level <=10;
    ----------------------------------------------------------------------------------------
    | Id  | Operation                    | Name  | Rows  | Bytes | Cost (%CPU)| Time    |
    ----------------------------------------------------------------------------------------
    |  0 | SELECT STATEMENT              |        |      |      |    1 (100)|          |
    |  1 |  COUNT                        |        |      |      |            |          |
    |  2 |  CONNECT BY WITHOUT FILTERING|        |      |      |            |          |
    |  3 |    VIEW                      |        |    1 |    13 |    1  (0)| 00:00:01 |
    |  4 |    SORT AGGREGATE            |        |    1 |    4 |            |          |
    |  5 |      INDEX FULL SCAN (MIN/MAX)| PK_EMP |    1 |    4 |    1  (0)| 00:00:01 |
    ----------------------------------------------------------------------------------------
    
    Cardinality estimated is one.
    
  • How can I get rid of windows 7 without deleting it and istalling a different operating system?

    How can I get rid of windows 7 without deleting it and istalling a different operating system?  I remember on xp, I couldn't allow him to function as a windows 95 or 98, if I wanted to.  I just want my computer works like windows xp.

    So can YER a little confused you explain a little better please.

    OR

    do you mean get W7 to resemble the way XP worked?

    In this case (start base fast and simple):

    • try to set a theme for a basic/classic theme - more like 98 then XP well.
    • Download (AV Control) and then use "classic shell" - menu style old XP.
    • Ditto for "explore classic" mentioned on this site.
    • Set the control panel to use the icons (small or large) as opposed to categories.

    But its still W7 in disguise.

    Is that the sort of thing you mean?

    If so, personally, I think its better to stick with W7 and get used to. I bet you will love windows 8 :)

  • PDTextSelectGetBoundingRect and PDETextGetBBox producing different bounding boxes

    I used PDTextSelectGetBoundingRect to get the bounding box of a single character, then I used PDETextGetBBox to retrieve the character bounding boxes in a PDEText element. However when I get to the character in question limit box will not come out the same. The left, right and the sides of the bottom of the box are coming as planned, but the top is larger, then the original box from PDTextSelectGetBoundingRect. Any idea on what could be the issue.

    These are not only different API, they are conceptually different and work in different ways (one on content EDP page, an abstraction of the graphical model and one on the PDWordFinder, a text extractor). I'm surprised that they are also similar because they are given many different concepts of "enclosing" you might find (square em, limit of control point, nominal path, path antialisesed limit, advance left-right text...)

    The mixture of these unfortunate necessity of the API isn't. You must apply a fuzzy logic to match its content and hope for the best.

  • Different plan for the same sql id

    Hello

    Our team of application reported recently that a query ran longer than usual.

    Search in tables AWR (dba_hist_active_sess_history & dba_hist_sqlstat), it was a change of plan_hash_value. The next day, without intervention from anyone (collect statistics did not run, no change in the tables involved) the sql used the former plan and completed quickly.

    The differences in the plan was the index that was used to access the table.

    What could be the reason for the optimizer to choose a bad plan and return once more the good thing. ?

    The code sql that has been run twice & three in one day and then it years off cursor cache.

    Regime shifts are normal.

    Flipfloppping plans are quite normal.

    I'd be willing to bet that a large percentage of your SQL shows variations in implementation plans and you never notice.

    And there are several reasons why you might get a different plan.

    1 bind variable peeking - it is normal SQL for the age from the cache and then get analyzed once again with different bind variable leading to different cardinality estimates and plans

    2. the statistics change - it is normal that the statistics of change over time causing different cardinality estimates and the various plans, especially if the histograms are involved and changing buckets

    3. data change - especially if you use dynamic sampling it is normal to get a different sample of data leading to different cardinality estimates and plans

    4 SYSDATE - it's normal for queries with SYSDATE in them to recognize that time is never on leave and which, in conjunction with statistics or data, can lead to different cardinality estimates and plans

    5. integrated optimization features - it's normal for features like ACS to kick in and notice that they got forecasts wrong in an execution plan and force the recalculation to a different plan with an adjusted cardinality.

    Using DBMS_XPLAN. DISPLAY_CURSOR or DISPLAY_AWR you can get different plans (provided that they are in memory or AWR). The notes section should indicate cardinality comments have been a factor. You can also get links peeked with format mask of "+ PEEKED_BINDS".

  • Not very nice or handy and iam correctly pressed the button to 19.66 and Adobe gave me the 12,09

    Not very nice or convenient to change that! and iam correctly pressed the button to 19.66 and Adobe gave me the 12.09, really push myself to the limit to try to change that, but is really not easy to do.

    Tomorrow I'm calling Adobe for explanation in this regard. go to sleep now and feel not very nice because I know not that I pushed the button for the whole pack to 19.66!

    Hello

    I cancelled the subscription photography Plan and reimburse.

    Please go ahead and sign up for the correct subscription.

    Kind regards

    Bev

  • I called Amazon to try to recover the serial number of my old iPod classic two weeks ago, and they gave me a kind of account; They pronounce it account 'seen - It '.

    I called Amazon to try to recover the serial number of my old iPod classic two weeks ago, and they gave me a kind of account; They pronounce it account 'seen - It '. I don't have to ask how, because I thought I knew, but I was wrong. Would what type of account be? And how it's spelled? The name of the account is a tiny s followed a 7-digit number. (Of course I will not type the numbers.)

    I would go to a forum for Amazon, because they can be better equipped to answer a question on their system. If synchronize you the device with iTunes, the number can be there in the backup section.  Find the serial number of your Apple - Apple Support product

  • Hello. I have perchased the new iphone, and I gave my old iphone to my little brother. I erased all the content and the date in the settings menu. This will automatically delete all my photos data old messages etc. thanks

    Hello. I recently perchased the new iphone, and I gave my old iphone to my little brother. I erased all the content and the date in the settings menu. This will automatically delete all my photos data old messages etc. thanks

    Follow the directions here: what to do before you sell or give away your iPhone, iPad or iPod touch - Apple Support before giving the phone to your brother. -AJ

  • How to take a column of duplicate names and fill a different column with the same names, excluding duplicates?

    How to take a column of duplicate names and fill a different column with the same names, excluding duplicates?

    I find easier to use this copy separate Automator Service (download Dropbox).

    To install in your numbers > Services, double-click menu just the package downloaded .workflow and if necessary give permissions in system preferences > security & privacy.

    To use, just:

    1. Select the cells in the column with duplicate names.
    2. Choose separate copy in numbers > Services menu.
    3. Click once in the upper cell where you want the deduplicated values appear.
    4. Command-v to paste.

    SG

  • What is the organizational structure of microsoft and what the different type of organization between microsoft and linux

    What is the organizational structure of microsoft and what the different type of organization between microsoft and linux

    Microsoft communities must answer a technical question about Windows 8, Windows 7, Windows Vista and Windows XP.

    If you have a technical question, please let us know. This type of information you are requesting is not available in this forum. Do a search on the internet, and you should be able to find this kind of information.

    Sincerely,

    Marilyn

  • System Restore will not work, said that there is an error and try a different restore point

    When I try to use the system restore it always fails, it says there is an error and try a different restore point, I did several times and it still does not work, can you help me. Thank you

    Hello

    This can help you:

    1. If you are using Norton, you should disable Norton inviolable Protection before using the system restore.

    http://Service1.Symantec.com/support/sharedtech.nsf/pfdocs/2005113009323013

    2. try to use Safe Mode system restore.

    http://bertk.MVPs.org/html/restoresysv.html

    3 Malware will stop at the system restore.

    Download, install, update and scan your system with the free version of Malwarebytes AntiMalware, if necessary in Mode safe mode with networking:

    http://www.Malwarebytes.org/products/malwarebytes_free

    And here's how to go in Safe Mode options; Select safe mode with networking from the list of options:

    http://Windows.Microsoft.com/en-us/Windows-Vista/start-your-computer-in-safe-mode

    See you soon.

  • SW2 - host App and Smart Connect different certificates. Host application cannot start.

    I had my 2 SmartWatch today and installed app Connect Smart and SmartWatch 2 since google play, got the smartwatch of pairing with my bluetooth phone manual connect.

    But in the notification bar I get "the application host and Smart Connect different certificates. Host App cannot start. "and I can't go settings on Smart Connect to the SW2.

    Please help, now I can't use the no apps smartwatch becouse...

    It's very strange, these files works fine for me in an S3.

    Would it be possible for you to make a backup of your phone then reset (or reinstall the software using Kies if possible), and then try again (before restoring the backup)?

  • Hi, I have wireless internet in my house and I gave my password system so that others in my home with laptops can use my provider internet-how can I change my password now?

    original title: Hi, I have wireless internet in my house and I gave my password system so that others in my home with laptops can use my internet provider. I want to change my password now. How can I do this or do I need to contact my provider to do this? __

    Hi, I have wireless internet in my house and I gave my password system so that others in my home with laptops can use my internet provider.  I want to change my password now.  How can I do that or do I need to contact my provider?

    Normally, you must have set a wireless router with a password to the wireless network using the wireless network that you have set up in your home.

    If above is the case, read the information that came with your router, or search for it on their website on how to change the settings in it.

    See you soon.

    Mick Murphy - Microsoft partner

Maybe you are looking for