4.0 EA1 - new explain Plan feature

Hi I was trying simply the new explain Plan feature (I like the look of) mentioned by Jeff Smith on his blog but if I get an "ORA-00942: table or view does not exist.

I get it doing the explain plan drop-down command selecting from V$ SQL_PLAN (synonym) and underlying base table V_$ SQL_PLAN. I am logged in as APPS, but that the user has select privileges on these objects sys to me. Don't know how you / he's got it to work (logged in as sys?) or if I give missing?

Paul

Grant select any dictionary apps privilege. Or, if your DBA prefers giving finer privileges on individual objects, you must also select on V$ SQL and V$ SQL_PLAN_STATISTICS.

Tags: Database

Similar Questions

  • Look at an explain plan

    version 11.2.0.4.0

    Solaris x 64 operating system

    Toad 9.0

    Hi, I'm trying to give a new user privleges see explain the plan. for this, I did the following

    grant select_catalog_role < username >;

    Grant execute on sys.dbms_xplan_type < username >;

    Grant execute on sys.dbms_xplan_type_table < username >;

    It didn't work, and then I have granted the select privilege on the table of existing plan to a new user.

    Grant select on sys.plan_table < username >;

    create synonym plan_table for sys.plan_table

    Yet it did not work, I got the error "ORA-01031: insufficient privileges" when you try to view explain plan.

    I even tried to create a new table of plan in this new scheme of the user by running the utlxplan.sql, but I get an error message saying that the table already exists.

    can someone help me please on where I'm wrong.

    Thank you

    «The question one EXPLAIN PLAN statement, you must have the necessary privileges to insert rows into a table of existing output that you specify to hold execution plan.»

    You must also have the necessary privileges to run the SQL statement to determine the execution plan. If the SQL statement accesses a view, you must have privileges to access any tables and views on which the opinion is based. If the view is of another opinion which is based on a table, you must have privileges to access the other point of view and its underlying table.

    To examine the execution plan produced by a EXPLAIN PLAN statement, you must have the necessary privileges to query the table of output.

    The EXPLAIN PLAN statement is a statement data manipulation language (DML), rather than a data definition language (DDL) statement. Therefore, Oracle database does not implicitly commit changes made by one EXPLAIN PLAN statement. If you want to keep the lines that are generated by a EXPLAIN PLAN in the output table, then you must commit to the transaction that contains the statement. »

    http://docs.Oracle.com/CD/E16655_01/server.121/e17209/statements_9010.htm#sthref6316

  • How to keep the formatting explain plan made on this forum

    Can you please tell me as a way to preserve the formatting of explain plan made on this forum. I tried to use the '-' tag, but failed.

    \

    PLAN_TABLE_OUTPUT

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

    Hash value of plan: 615168685

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

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

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

    |   0 | SELECT STATEMENT |      |    23.  1242.     7 (15) | 00:00:01 |

    |*  1 |  HASH JOIN |      |    23.  1242.     7 (15) | 00:00:01 |

    |   2.   TABLE ACCESS FULL | DEPT |    13.   234.     3 (0) | 00:00:01 |

    |   3.   TABLE ACCESS FULL | EMP |    23.   828 |     3 (0) | 00:00:01 |

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

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

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

    1 - access("E".") DEPTNO "=" D ". ("' DEPTNO ')

    15 selected lines.

    \

    Go to advanced editor and change the font to a fixed-width font e.g. Courier New

    PLAN_TABLE_OUTPUT

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

    Hash value of plan: 615168685

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

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

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

    |   0 | SELECT STATEMENT |      |    23.  1242.     7 (15) | 00:00:01 |

    |*  1 |  HASH JOIN |      |    23.  1242.     7 (15) | 00:00:01 |

    |   2.   TABLE ACCESS FULL | DEPT |    13.   234.     3 (0) | 00:00:01 |

    |   3.   TABLE ACCESS FULL | EMP |    23.   828 |     3 (0) | 00:00:01 |

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

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

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

    1 - access("E".") DEPTNO "=" D ". ("' DEPTNO ')

    15 selected lines.

  • Difference of cardinality estimate on explain plan and implementation plan

    I think some of you know the 5% rule, which is explained in the note on metalink # 68992.1.
    In short, this means that (with bind peeking out voltage)
    - c1 > :b1 : 5% of selectivity
    - c1 >= :b1 :5% of selectivity
    - c1 between :b1 and :b2 : 0.25% of selectivity (5% * 5%)
    It is also well explained fundamentals of the CBO by Jonathan Lewis.

    But I found a few odd cases where the 5% rule is broken DURATION estimate.
    The most interesting part is explain plan watch again the 5% rule.
    Why the difference?

    I think that with bind peeking out, explain the plan and the implementation plan should show the same things.
    (Assuming that all values of the environment are identical)
    Am I wrong?

    It's the long story to tell, but simple test cases will show what I mean.
    UKJA@ukja102> @version
    
    BANNER
    ---------------------------------------------------------------------
    ---------------------------------------------------------------------
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
    PL/SQL Release 10.2.0.1.0 - Production
    CORE    10.2.0.1.0      Production
    TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    
    UKJA@ukja102>
    UKJA@ukja102> set echo on
    UKJA@ukja102>
    UKJA@ukja102> drop table t1 purge;
    
    Table dropped.
    
    Elapsed: 00:00:00.09
    UKJA@ukja102>
    UKJA@ukja102> create table t1(c1 int, c2 int)
      2  ;
    
    Table created.
    
    Elapsed: 00:00:00.01
    UKJA@ukja102>
    UKJA@ukja102> insert into t1
      2  select 1, level
      3  from dual
      4  connect by level <= 10000
      5  union all
      6  select 2, level
      7  from dual
      8  connect by level <= 1000
      9  union all
     10  select 3, level
     11  from dual
     12  connect by level <= 100
     13  union all
     14  select 4, level
     15  from dual
     16  connect by level <= 10
     17  union all
     18  select 5, level
     19  from dual
     20  connect by level <= 1
     21  ;
    
    11111 rows created.
    
    Elapsed: 00:00:00.32
    UKJA@ukja102>
    UKJA@ukja102> exec dbms_stats.gather_table_stats(user, 't1', method_opt=>'for all columns size 1');
    
    PL/SQL procedure successfully completed.
    * Disable bind peeking. *
    UKJA@ukja102>
    UKJA@ukja102> alter session set "_optim_peek_user_binds" = false;
    In the following result, explain the plan following the 5% rule.
    (11111 * 0.05 = 555)
    UKJA@ukja102>
    UKJA@ukja102> explain plan for
      2  select count(*)
      3  from t1
      4  where c1 > :b1
      5  ;
    
    Explained.
    
    Elapsed: 00:00:00.01
    UKJA@ukja102>
    UKJA@ukja102> @plan
    UKJA@ukja102> select * from table(dbms_xplan.display)
      2  /
    
    PLAN_TABLE_OUTPUT                                                              
    --------------------------------------------------------------------------------
    Plan hash value: 3724264953                                                    
                                                                                   
    ---------------------------------------------------------------------------    
    | Id  | Operation          | Name | Rows  | Bytes | Cost (%CPU)| Time     |    
    ---------------------------------------------------------------------------    
    |   0 | SELECT STATEMENT   |      |     1 |     3 |     6   (0)| 00:00:01 |    
    |   1 |  SORT AGGREGATE    |      |     1 |     3 |            |          |    
    |*  2 |   TABLE ACCESS FULL| T1   |   556 |  1668 |     6   (0)| 00:00:01 |    
    ---------------------------------------------------------------------------    
                                                                                   
    Predicate Information (identified by operation id):                            
    ---------------------------------------------------                            
                                                                                   
       2 - filter("C1">TO_NUMBER(:B1))                                             
    
    14 rows selected.
    
    Elapsed: 00:00:00.01
    But the term plan does'nt follow the 5% rule. It uses its own density
    (11111 * density (c1) = 11111 * 0.2 = 2222)
    UKJA@ukja102> select /*+ gather_plan_statistics */
      2    count(*)
      3  from t1
      4  where c1 > :b1
      5  ;
    
      COUNT(*)                                                                     
    ----------                                                                     
          1111                                                                     
    
    Elapsed: 00:00:00.00
    UKJA@ukja102>
    UKJA@ukja102> @stat
    UKJA@ukja102> select * from table
      2  (dbms_xplan.display_cursor(null,null,'allstats cost last'));
    
    PLAN_TABLE_OUTPUT                                                              
    --------------------------------------------------------------------------------
    SQL_ID  0nmqsysmr3ap9, child number 0                                          
    -------------------------------------                                          
    select /*+ gather_plan_statistics */   count(*) from t1 where c1 > :b1         
                                                                                   
    Plan hash value: 3724264953                                                    
                                                                                   
    --------------------------------------------------------------------------------
    ------------------                                                             
                                                                                   
    | Id  | Operation          | Name | Starts | E-Rows | Cost (%CPU)| A-Rows |   A-
    Time   | Buffers |                                                             
                                                                                   
    --------------------------------------------------------------------------------
    ------------------                                                             
                                                                                   
    |   1 |  SORT AGGREGATE    |      |      1 |      1 |            |      1 |00:00
    :00.01 |      23 |                                                             
                                                                                   
    |*  2 |   TABLE ACCESS FULL| T1   |      1 |   2223 |     6   (0)|   1111 |00:00
    :00.01 |      23 |                                                             
                                                                                   
    --------------------------------------------------------------------------------
    ------------------                                                             
                                                                                   
                                                                                   
    Predicate Information (identified by operation id):                            
    ---------------------------------------------------                            
                                                                                   
       2 - filter("C1">:B1)                                                        
                                                                                   
    
    18 rows selected.
    the 5% rule seems to be
    -applied to explain the plan always
    -applied at the level of enforcement only when density 5 < %. When the density > 5%, he uses the density not 5%

    I'm not sure it's a designed feature or a bug.
    But estimates of different cardinality explain a plan and DURATION (with bind peeking out voltage) is not that desirable thing.


    One's opinion on this?

    Dion Cho

    Sorry to take some time to get back on this one.

    I can reproduce your results in 10.2.0.1, but the anomaly is not present in 9.2.0.8 and 10.2.0.3 and 11.1.0.6.
    As Charles, the calculation has a boundary condition when a num_diistinct falls below 20
    (i.e. when a value is more than 5% of the total data set - average).

    However, the fact that explain the plan and the run time you give estimates of different cardinality is a bug.
    Everything they say, they should say the same thing at least that the introduction of the variable binding
    introduced a possible type conversion or the NLS conversion feature that has changed the
    calculation of the expected cardinality. In this case there is no reason why the use of links should be
    cause confusion - so we can reasonably assume that it is a bug.

    Concerning
    Jonathan Lewis
    http://jonathanlewis.WordPress.com
    http://www.jlcomp.demon.co.UK

    "The greatest enemy of knowledge is not ignorance, it is the illusion of knowledge." (Stephen Hawking)

  • How to create a new power plan that includes key backlit stop?

    I can't find any setting in the advanced power properties dialog box. Toshiba has provided a power eco plan. It's OK for me except the pilot. So I tried to create a power plan as eco with night light 1 hour not 5 minutes.
    However, this plan does not backlight key off.

    How can I create a new power plan that includes key backlit stop?

    Have you tried to change the power management Windows including power advanced for certain power plan options?
    For example, you can use balanced plan or standby power, change it and that s it.

  • Explain the explain plan

    decide to move to optimization soon. Book says join faster that the subquery in this example because the analyses involved. The "cost" to the subquery appears lower than the cost for the join. So it is confusing to me - aka How should I be interpreting this.

    Plan of subquery:

    image2.png.jpg

    join plan

    image2.png.jpg

    as you can see that the plan for the subquery has less than a cost. Could someone explain these outputs as to which application is more effective. I need to start somewhere.

    Thank you!

    The BEST way to get help when you ask questions is:

    1 ask questions on SPECIFIC things

    2. tell us EXACTLY what term, value, etc. ask abaout

    Book says join faster that the subquery in this example because the analyses involved. The "cost" to the subquery appears lower than the cost for the join. So it is confusing to me - aka How should I be interpreting this.

    OK - what BOOK are you talking about? There is not much interest to mention a book if you're not going to tell us which book it and provide a link to it and even a page number. This gives us the SCOPE of your question.

    This "cost for the subquery" are you talking about? Be specifc. It is in one of the plans that you posted? What plan? Whose cost is it? For example, you could say:

    I have a question for the foreground below. Why is the cost to the xx line lower than the cost of the second plan on line AA?

    This question refers CLEARLY to the info we're talking. The way in which you stating the question, we try to guess what plan and the lines you want to say.

    subquery plan:
    
    
    join plan
    
    
    as you can see the subquery plan has less of a cost. Could someone explain from these outputs as to which query is more efficient. I need to start from somewhere.
    

    Are you talking about line #1 in each of these plans?

    Please edit your post and tell us EXACTLY what you ask in the topic and refer to values and SPECIFIC lines. Also post a link to the book and a reference to a page number you got the information from.

    The optimizer generally chooses the REAL implementation with the lowest cost plan. It is not clear whether the plans that you have posted are ACTUAL spending plans that Oracle really determined and used or just explain plans.for what Oracle thought it might use.

    If the statistics are not up-to-date these plans do not yet reflect the reality of the data.

    And if the amount of data is a small number of blocks or other of these plans can run better than the other in reality.

    You can find this Oracle white paper "Explain the Plan explaining" useful

    http://www.Oracle.com/technetwork/database/bi-Datawarehousing/TWP-explain-the-explain-plan-052011-393674.PDF

  • Why do my work order plan getting all messed up when I try to add new work plans?

    Mac, HAVE CC

    If I create an icon for fine UX library. I have, say, 20 icons on 20 separate work plans. I have the following configuration: 4 lines and 5 columns. Create mu icons, name each work plan to export properly, and all is well.

    But when I come back to this document and try to add work plans, they add no way to 5 x 4.

    Very strangely, they are added in random places.

    Then I try again to "Reorganize the work plans", and they are willing, but once again, in a random order. My names are so disconnected from the previous relevant work plans.

    It's so frustrating. Is there something I'm missing, if it please or do not know, to add better control?

    Thank you very much!!!

    I think everyone goes through a similar confusion with work plans, but once to slow down and realize some items, they begin to work as

    1. Look at your work plan and that one is highlighted it's the artboard select
    2. You can easily unwittingly switch to another plan of work, by simply selecting another time with the selection tool. "Here, I've selected an item on the 4th game of darts and now the ' Live from the corners" artbaord is selected.
    3. When you use the new work plan command that adds a new after the selected work plan, some people waiting to be added as the last page.
    4. There are some bugs like when you run out of space on the right. I have the last elected artboard, but try to add a new work plan gives me an error because the top row is out of room who shovel have nothing to do with it.

    In summary

    • Name your work plans that you can easily get confused, that it is worth
    • Use reorganize artbaords often
    • Reorganize work plans does not care the physical position on the screen of the work plan, it transposes numbers (1 to 11 in my example above)
    • If you want to copy of artboard on the artboard 2 1. Copy the artboard 1 form, select any element of the artbord 2 and use the paste in front or to the rear. You can also use the work plans Panel to select your target artbaord.
  • move the selection to the new work plan

    Hi guys,.

    I'm new to Illustrator script but I have done some in InDesign.

    I want a script to move a selection to a new work plan and be able to name the work plan.

    I can't find something in the DOM as artboards.add ().

    Any help?

    Hi jakec88782761,

    are what version of picture you?

    Working with work plans is possible since CS4 +.

    Here's a simple example in [JS]

    var AB_1 = activeDocument.artboards.add([0,50,200,0]);
    AB_1.name = 'first quadrant';
    var AB_2 = activeDocument.artboards.add([-200,50,0,0]);
    AB_2.name = 'second quadrant';
    var AB_3 = activeDocument.artboards.add([-200,0,0,-50]);
    AB_3.name = 'third quadrant';
    var AB_4 = activeDocument.artboards.add([0,0,200,-50]);
    AB_4.name = 'fourth quadrant';
    

    Have fun

  • Need to explain Plan output in HTML format

    Hello

    I have details slider sqlid and child. And I'm able to generate explain plan SQL running as below

    SELECT * FROM table (DBMS_XPLAN. DISPLAY_CURSOR('xxxxxxxxxxxxxx',0,'ALLSTATS'));

    I need send the output of this customer. and the problem is the customer wants in HTML format. Advice to reel in HTML format

    concerning

    Pravin

    You can always query the PLAN_TABLE directly, and use SQL * more to empty in HTML.

    Another option is to do this with SQL Developer. Paste the SQL statement into the worksheet, and then press the explain Plan. When you see the plan, right-click on it and choose export as HTML.

    See you soon,.
    Brian

  • Need help with understanding explain plan

    Hi all

    I'm trying to understand the subject of the explain Plan, and while I was reading a document and from there I found one of the query that is below:

    Query

    SELECT A.customer_name,

    Count (distinct b.invoice_id) 'open invoices. "

    Count (c.invoice_id) "open invoice".

    Clients has,

    b invoices,

    c invoices_items

    WHERE b.invoice_status = 'OPEN'

    AND A.customer_id = b.customer_id

    AND c.invoice_id (+) = b.invoice_id

    A.customer_name GROUP

    Explain Plan

    See attached file...

    explain_plan.JPG

    I appreciate if someone explain this attached plan really explain in detail for my purpose of learning. Thanks in advance

    Concerning

    Muzz

    I'm trying to understand the subject of the explain Plan

    Excellent!

    I suggest you just started reading the book of Maria Colgan white "Explain the explain Plan".

    http://www.Oracle.com/technetwork/database/bi-Datawarehousing/TWP-explain-the-explain-plan-052011-393674.PDF

    This white paper examines the different lines, you will see in a plan and what they mean.

  • Explain plan for select distinct

    I got 1 of the online test and there the question has been asked. I have already answered but curious to cross-check my response with your advice...

    Question

    Explain what information plan if the show room in SQL indicates that a separate select statement is made in the SQL.


    The choices are:

    Sort by a join

    b sort by

    c single fate

    d sort aggregate

    group e - sort by

    My answer

    I gave aggregates of SORT but it seems that his unique kind, because when I run explain plan then I see (unique) hash. Please guide


    SEPARATE will identify unique rows. So in the given choice it would be KIND of UNIQUE. But oracle could go other plans as UNIQUE HASH or same INDEX FULL SCAN.

    Look at the oracle does not SORT.

    SQL> select distinct ename from emp;
    ENAME
    ------
    SMITH
    BLAKE
    CLARK
    KING
    ADAMS
    TURNER
    ALLEN
    SCOTT
    JONES
    MARTIN
    WARD
    11 rows selected.
    SQL> select * from table(dbms_xplan.display_cursor);
    PLAN_TABLE_OUTPUT
    ---------------------------------------------------------------------------------
    SQL_ID  6b32yqumjmp9b, child number 0
    -------------------------------------
    select distinct ename from emp
    Plan hash value: 984151148
    ---------------------------------------------------------------------------
    | Id  | Operation          | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    ---------------------------------------------------------------------------
    |   0 | SELECT STATEMENT   |      |       |       |     3 (100)|          |
    |   1 |  HASH UNIQUE       |      |    11 |    66 |     3  (34)| 00:00:01 |
    |   2 |   TABLE ACCESS FULL| EMP  |    11 |    66 |     2   (0)| 00:00:01 |
    ---------------------------------------------------------------------------
    
    14 rows selected.
    

    Let me make an explicit ORDER BY for her to performa SORT.

    SQL> select distinct ename from emp order by 1;
    ENAME
    ------
    ADAMS
    ALLEN
    BLAKE
    CLARK
    JONES
    KING
    MARTIN
    SCOTT
    SMITH
    TURNER
    WARD
    11 rows selected.
    SQL> select * from table(dbms_xplan.display_cursor);
    PLAN_TABLE_OUTPUT
    -------------------------------------------------------------------------------
    SQL_ID  f72vjx5rmm0z4, child number 0
    -------------------------------------
    select distinct ename from emp order by 1
    Plan hash value: 725351111
    ---------------------------------------------------------------------------
    | Id  | Operation          | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    ---------------------------------------------------------------------------
    |   0 | SELECT STATEMENT   |      |       |       |     4 (100)|          |
    |   1 |  SORT UNIQUE       |      |    11 |    66 |     3  (34)| 00:00:01 |
    |   2 |   TABLE ACCESS FULL| EMP  |    11 |    66 |     2   (0)| 00:00:01 |
    ---------------------------------------------------------------------------
    
    14 rows selected.
    SQL>
    

    Version - 10.2.0.5.0

  • explain plan

    Hi all

    I use under version

    Connected to Oracle Database 11g Express Edition Release 11.2.0.2.0

    SQL > SELECT DEPTNO

    DEPT 2

    3. WHERE DEPTNO! = ALL

    4 (DEPTNO SELECT FROM EMP WHERE DEPTNO IS NOT NULL);

    DEPTNO

    ----------

    40

    Execution plan

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

    Hash value of plan: 474461924

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

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

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

    |   0 | SELECT STATEMENT |      |     4.   104.     5 (20) | 00:00:01 |

    |*  1 |  HASH ANTI JOIN |      |     4.   104.     5 (20) | 00:00:01 |

    |   2.   TABLE ACCESS FULL | DEPT |     4.    52.     2 (0) | 00:00:01 |

    |*  3 |   TABLE ACCESS FULL | EMP |    14.   182.     2 (0) | 00:00:01 |

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

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

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

    1 - access ("DEPTNO" ="DEPTNO")

    3 - filter ("DEPTNO" IS NOT NULL)

    Note

    -----

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

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

    SQL > SELECT DEPTNO FROM DEPT

    2. IF YOU USE NOT IN DEPTNO (DEPTNO SELECT FROM EMP WHERE DEPTNO IS NOT NULL);

    DEPTNO

    ----------

    40

    Execution plan

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

    Hash value of plan: 474461924

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

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

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

    |   0 | SELECT STATEMENT |      |     4.   104.     5 (20) | 00:00:01 |

    |*  1 |  HASH ANTI JOIN |      |     4.   104.     5 (20) | 00:00:01 |

    |   2.   TABLE ACCESS FULL | DEPT |     4.    52.     2 (0) | 00:00:01 |

    |*  3 |   TABLE ACCESS FULL | EMP |    14.   182.     2 (0) | 00:00:01 |

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

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

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

    1 - access ("DEPTNO" ="DEPTNO")

    3 - filter ("DEPTNO" IS NOT NULL)

    Note

    -----

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

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

    SQL > SELECT DEPTNO

    DEPT 2

    3. WHERE THERE IS NO

    4 (SELECT * FROM EMP WHERE EMP.) DEPTNO = DEPT. DEPTNO);

    DEPTNO

    ----------

    40

    Execution plan

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

    Hash value of plan: 474461924

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

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

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

    |   0 | SELECT STATEMENT |      |     4.   104.     5 (20) | 00:00:01 |

    |*  1 |  HASH ANTI JOIN |      |     4.   104.     5 (20) | 00:00:01 |

    |   2.   TABLE ACCESS FULL | DEPT |     4.    52.     2 (0) | 00:00:01 |

    |   3.   TABLE ACCESS FULL | EMP |    14.   182.     2 (0) | 00:00:01 |

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

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

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

    1 - access("EMP".") DEPTNO "=" DEPT ". ("' DEPTNO ')

    Note

    -----

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

    My doubt is as all the query 3 generates even explain plan

    Can we consider that all queries to be the same as in the review of the performance.

    Thank you

    NOT IN and EXISTS are not the same. If there is only one NULL value in the sub query used with NOT IN then any condition fails.

    Here is a note of AskTom on this topic

    https://asktom.Oracle.com/pls/Apex/f?p=100:11:0:P11_QUESTION_ID:442029737684

  • Understanding explain plan

    Hi gurus

    I try to explain the plan and referring to the link that http://docs.oracle.com/database/121/TGSQL/tgsql_interp.htm#TGSQL277understand/learn, see below for more details:

    1st step

    EXPLAIN PLAN

    SET statement_id = "ex_plan1" FOR

    SELECT phone_number

    Employees

    WHERE phone_number AS 650% ';

    step 2

    SELECT PLAN_TABLE_OUTPUT

    TABLE (DBMS_XPLAN. DISPLAY (NULL, 'ex_plan1', 'BASIC'));

    Output

    PLAN_TABLE_OUTPUT

    Hash value of plan: 1445457117

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

    | ID | Operation | Name |

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

    |   0 | SELECT STATEMENT |           |

    |   1.  TABLE ACCESS FULL | EMPLOYEES |

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

    If you have watched the plan explained above then in operation, he leads shows TABLE ACCESS FULL.

    Let's see now another for we explain with other data, see below

    Step 3

    EXPLAIN PLAN

    SET statement_id = "ex_plan2" FOR

    SELECT last_name

    Employees

    WHERE name LIKE '% Pe;

    Step 4

    SELECT PLAN_TABLE_OUTPUT

    TABLE (DBMS_XPLAN. DISPLAY (NULL, 'ex_plan2', 'BASIC'));

    Output

    PLAN_TABLE_OUTPUT

    Hash value of plan: 3085132068

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

    | ID | Operation | Name |

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

    |   0 | SELECT STATEMENT |             |

    |   1.  INDEX RANGE SCAN | EMP_NAME_IX |

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

    First Question:
    When I run the sql below:

    SELECT phone_number

    Employees

    WHERE phone_number AS 650% ';

    so why does it display FULL TABLE ACCESS

    on the other hand, when I have executed under SQL:

    SELECT last_name

    Employees

    WHERE name LIKE '% Pe;

    so why it shows INDEX RANGE SCAN even the two queries by using like operator.

    2nd question

    In step 4 in the section operation, what is the meaning of the INDEX RANGE SCAN?

    3rd issue

    In step 4, under the name of topic, what is the meaning of EMP_NAME_IX?

    Thanks in advance

    Concerning

    Shu


    All this would be in the documentation.

    The second query uses a different plan because there was a clue on last_name.

    Index range scan is exactly what it sounds like - it scans the index to find the appropriate values

    emp_name_ix is the name of the index that it scans.

  • SQL not using indexes at runtime, but by using the index in "explain plan".

    Hi all

    I am facing a problem here that I don't get to think.

    I have a SQL that makes a FULL ACCESS of TABLE into two tables and its costs are very high, but it occurs only when I run it in my program (I saw it in the session trace). If I do a "explain plan" sqlplus (SQL Navigator or PLSQL Developer) it shows that he use indexes and have a low cost. I already checked the statistics from both tables, and they are up to date.

    Did someone never facing a similar problem or knows something I can do to find my problem?

    Thank you all very much.

    Hello

    As far as I KNOW, optimizer Oracle never guarantees that an Index scan in query explain plan will be necessarily used during query execution.

    ORACLE-BASE - DBMS_XPLAN: Oracle display execution Plans

    Could you please read the above, run the query, as described and check the execution using DBMS_XPLAN plan. The cursor cache DISPLAY_CURSOR and not PLAN_TABLEs.

  • 3 clues on 3 different columns, but explain plan shows full table scan for select queries

    I have a table - used and have index - functional ind1 (upper (f_name)), index - (emp_id) ind2 ind3 (upper (l_name) functional on 3 columns diffferent - what, emp_id, l_name respectively.) Now when I check explain plans for sub queries, they all have two shows complete table for the employee of the table scan. FYI - employee table is non-parittioned.

    Can someone tell me why 3 indices are not used here?

    (1) select emp_id, upper (f_name), upper (l_name) of the employee

    (2) select upper (f_name), mp_id, upper (l_name) of the employee

    where upper (f_name) = upper (f_name)

    and emp_id = emp_id

    and upper (l_name) = upper (l_name)

    If I can push oracle (version 11) to use these indexes somewho - maybe using tips? Any help is appreciated.

    
    Observations:
    
    SQL> desc emp1;
     Name                                      Null?    Type
     ----------------------------------------- -------- -----------------
     EMPID                                      NOT NULL NUMBER
     F_NAME                                    NOT NULL VARCHAR2(3)
     L_NAME                                    NOT NULL VARCHAR2(3)
     SALARY                                    NUMBER
     JOB_ROLE                                 VARCHAR2(5)
     DEPTID                                     NUMBER
    
    create index idx2 on emp1(empid);
    create index idx1 on emp1(upper(f_name) );
    create index idx3 on emp1(f_name,empid, l_name);
    exec dbms_stats.gather_table_stats(user,'EMP1', cascade=>true);
    
    8 rows selected.
    
    SQL> explain plan for
      2  select /*+ index_join(e idx1 idx2 idx3)*/   upper(l_name),empid, upper(f_name) from emp1 e;
    
    Explained.
    
    SQL> select * from table(dbms_xplan.display);
    
    PLAN_TABLE_OUTPUT
    --------------------------------------------------------------------------------
    Plan hash value: 3449967945
    
    -------------------------------------------------------------------------
    | Id  | Operation        | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    -------------------------------------------------------------------------
    |   0 | SELECT STATEMENT |      | 20000 |   175K|    14   (0)| 00:00:01 |
    |   1 |  INDEX FULL SCAN | IDX3 | 20000 |   175K|    14   (0)| 00:00:01 |
    -------------------------------------------------------------------------
    
    8 rows selected.
    
    SQL> explain plan for
      2  select    upper(f_name),empid,upper(l_name) from emp1 e;
    
    Explained.
    
    SQL> select * from table(dbms_xplan.display);
    
    PLAN_TABLE_OUTPUT
    --------------------------------------------------------------------------------
    Plan hash value: 3449967945
    
    -------------------------------------------------------------------------
    | Id  | Operation        | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    -------------------------------------------------------------------------
    |   0 | SELECT STATEMENT |      | 20000 |   175K|    14   (0)| 00:00:01 |
    |   1 |  INDEX FULL SCAN | IDX3 | 20000 |   175K|    14   (0)| 00:00:01 |
    -------------------------------------------------------------------------
    
    8 rows selected.
    
    SQL> explain plan for
      2  select /*+ index_ffs(e idx3)*/   upper(l_name),empid, upper(f_name) from emp1 e;
    
    Explained.
    
    SQL> select * from table(dbms_xplan.display);
    
    PLAN_TABLE_OUTPUT
    --------------------------------------------------------------------------------
    Plan hash value: 2496145112
    
    -----------------------------------------------------------------------------
    | Id  | Operation            | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    -----------------------------------------------------------------------------
    |   0 | SELECT STATEMENT     |      | 20000 |   175K|    14   (0)| 00:00:01 |
    |   1 |  INDEX FAST FULL SCAN| IDX3 | 20000 |   175K|    14   (0)| 00:00:01 |
    -----------------------------------------------------------------------------
    
    8 rows selected.
    
    SQL> explain plan for
      2  select /*+ index(e idx3)*/   upper(l_name),empid, upper(f_name) from emp1 e;
    
    Explained.
    
    SQL> select * from table(dbms_xplan.display);
    
    PLAN_TABLE_OUTPUT
    --------------------------------------------------------------------------------
    Plan hash value: 3449967945
    
    -------------------------------------------------------------------------
    | Id  | Operation        | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    -------------------------------------------------------------------------
    |   0 | SELECT STATEMENT |      | 20000 |   175K|    14   (0)| 00:00:01 |
    |   1 |  INDEX FULL SCAN | IDX3 | 20000 |   175K|    14   (0)| 00:00:01 |
    -------------------------------------------------------------------------
    
    8 rows selected.
    
    SQL> explain plan for
      2  select    upper(f_name),empid,upper(l_name) from emp1 e;
    
    Explained.
    
    SQL> select * from table(dbms_xplan.display);
    
    PLAN_TABLE_OUTPUT
    --------------------------------------------------------------------------------
    Plan hash value: 3449967945
    
    -------------------------------------------------------------------------
    | Id  | Operation        | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    -------------------------------------------------------------------------
    |   0 | SELECT STATEMENT |      | 20000 |   175K|    14   (0)| 00:00:01 |
    |   1 |  INDEX FULL SCAN | IDX3 | 20000 |   175K|    14   (0)| 00:00:01 |
    -------------------------------------------------------------------------
    
    8 rows selected.
    
    SQL> drop index idx3;
    
    Index dropped.
    
    SQL> explain plan for
      2     select   upper(l_name),empid, upper(f_name) from emp1 e;
    
    Explained.
    
    SQL> select * from table(dbms_xplan.display);
    
    PLAN_TABLE_OUTPUT
    --------------------------------------------------------------------------------
    Plan hash value: 3330885630
    
    --------------------------------------------------------------------------
    | Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    --------------------------------------------------------------------------
    |   0 | SELECT STATEMENT  |      | 20000 |   175K|    18   (0)| 00:00:01 |
    |   1 |  TABLE ACCESS FULL| EMP1 | 20000 |   175K|    18   (0)| 00:00:01 |
    --------------------------------------------------------------------------
    
    8 rows selected.
    
    SQL> create index idx3 on emp1(f_name,empid, l_name );
    
    Index created.
    
    SQL>  explain plan for
      2     select   upper(l_name),empid, upper(f_name) from emp1 e;
    
    Explained.
    
    SQL> select * from table(dbms_xplan.display);
    
    PLAN_TABLE_OUTPUT
    --------------------------------------------------------------------------------
    Plan hash value: 3449967945
    
    -------------------------------------------------------------------------
    | Id  | Operation        | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    -------------------------------------------------------------------------
    |   0 | SELECT STATEMENT |      | 20000 |   175K|    14   (0)| 00:00:01 |
    |   1 |  INDEX FULL SCAN | IDX3 | 20000 |   175K|    14   (0)| 00:00:01 |
    

Maybe you are looking for

  • Satellite P870 - Toshiba value added package cannot be shown in my language

    Hello, everyone. I have problem a Toshiba value added package. I bought a Satellite P870.When I use WIN7 by Toshiba NB recovery system, the display language after pressing the Fn key is correct (Chinese). But I want to reinstall Win7 clean by myself,

  • fix-it-error Windows Code 0x803C0107

    I'm running vista home prem 32-bit. Windows said does not work in any action. Things I try to run I get #0x803C0107 error code. I removed the fix - it and then downloaded again loaded fix - it. I always get the same result. How can I fix this problem

  • SW of Smartphones blackBerry bundle update for 9220

    Hello can you please confirm the last beam of sw for 9220? The unit has not been used in the past 12 months, and in trying to update, I get a popup with "Unable to send the request for available updates".The loaded current version is v 7.1.0.836. BTW

  • Windows will warn if Check Disk detects irreparable damage?

    For Windows 7, if the disk check utility is used on the C drive and includes a review of surface (what will happen to the restart of the computer), Windows will notify the user in a clear manner if there is a critical problem found, or it is entirely

  • How to find the files to write to a cd

    It's about all the info I can give you.  flattery Geri