SQl  excecute plan

SQL Statement
SELECT
  "VBELN" , "PARVW" , "KUNNR"
FROM
  "VBPA"
WHERE
  "MANDT" = '210' AND "VBELN" IN ( '400000','400019','400019','400066','400066','500000' ) AND (
  "PARVW" = 'AG' OR "PARVW" = 'RE' )
Execution Plan
SELECT STATEMENT ( Estimated Costs = 1 , Estimated #Rows = 8 )
        3 INLIST ITERATOR
            2 TABLE ACCESS BY INDEX ROWID VBPA
              ( Estim. Costs = 1 , Estim. #Rows = 8 )
                1 INDEX RANGE SCAN VBPA~Z01
                  ( Estim. Costs = 2 , Estim. #Rows = 8 )
                  Search Columns: 3
<b>Could you give me a explanation of this excecute plan aboved ?</b>

Hi guixin,
1. SELECT STATEMENT ( Estimated Costs = 1 , Estimated #Rows = 8 )
  It says that the command given to the
   database is a select statement.
  (other commands like insert, delete are also possible)
2.INLIST ITERATOR
  The database has to do some additional
  process based upon the SQL.
  The sql contains an IN statement.
VBELN" IN ( '400000','400019','400019','400066','400066','500000'
3. TABLE ACCESS BY INDEX ROWID VBPA
( Estim. Costs = 1 , Estim. #Rows = 8 )
The database has accessed the table
and used an index available on the table
instead of FULL SCAN on the table.
4. 1 INDEX RANGE SCAN VBPA~Z01
( Estim. Costs = 2 , Estim. #Rows = 8 )
Search Columns: 3
Based upon the index, the database
  scanned the table based upon rowid
and as required, searched for 3 columns.
regards,
amit m.

Similar Messages

  • Need help in SQL Explain plan

    Hi,
    I was trying to get an explain plan for below query. (Refer - A)
    BILL_DETAIL table have index of ZONECODE,MRNO,AREACODE,WCNO but still it's
    showing 'TABLE ACCESS FULL in BILL_DETAIL'
    If i select only first 4 column, it is going by index. (REFER - B)
    As per my knowledge index will consider only where clause conditions
    but here I couldn't understand why this considering select output columns.
    First time I am trying sql explain plan statement, Please help me to correct
    this query.
    REFER - A
    EXPLAIN PLAN FOR
    SELECT B.ZONECODE ZONECODE, B.MRNO MRNO, B.AREACODE AREACODE, B.WCNO WCNO,
    B.BILLNO BILLNO,B.BILLDT BILLDT,B.FROMDT FROMDT,B.TODT TODT,B.TOBEPAID TOBEPAID,
    B.PREVUNPAID PREVUNPAID,B.DUEDT DUEDT
    FROM BILL_DETAIL B, CONSUMER_MASTER C
    WHERE B.ZONECODE = C.ZONECODE
    AND B.MRNO = C.MRNO
    AND B.AREACODE = C.AREACODE
    AND B.WCNO = C.WCNO
    AND UPPER(B.ZONECODE)=UPPER('SZ-4')
    AND UPPER(B.MRNO)=UPPER('347')
    AND UPPER(B.AREACODE)=UPPER('18')
    AND UPPER(B.WCNO)=UPPER('30910')
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)|
    | 0 | SELECT STATEMENT | | 1 | 71 | 9 (0)|
    | 1 | NESTED LOOPS | | 1 | 71 | 9 (0)|
    |* 2 | TABLE ACCESS FULL| BILL_DETAIL | 1 | 52 | 9 (0)|
    |* 3 | INDEX UNIQUE SCAN| SYS_C008803 | 1 | 19 | 0 (0)|
    Predicate Information (identified by operation id):
    2 - filter(UPPER("B"."ZONECODE")='SZ-4' AND UPPER("B"."MRNO")='347'
    AND UPPER("B"."AREACODE")='18' AND UPPER("B"."WCNO")='30910')
    3 - access("B"."ZONECODE"="C"."ZONECODE" AND "B"."MRNO"="C"."MRNO"
    AND "B"."AREACODE"="C"."AREACODE" AND "B"."WCNO"="C"."WCNO")
    REFER - B
    EXPLAIN PLAN FOR
    SELECT B.ZONECODE ZONECODE, B.MRNO MRNO, B.AREACODE AREACODE, B.WCNO WCNO
    FROM BILL_DETAIL B, CONSUMER_MASTER C
    WHERE B.ZONECODE = C.ZONECODE
    AND B.MRNO = C.MRNO
    AND B.AREACODE = C.AREACODE
    AND B.WCNO = C.WCNO
    AND UPPER(B.ZONECODE)=UPPER('SZ-4')
    AND UPPER(B.MRNO)=UPPER('347')
    AND UPPER(B.AREACODE)=UPPER('18')
    AND UPPER(B.WCNO)=UPPER('30910')
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)|
    | 0 | SELECT STATEMENT | | 1 | 34 | 4 (0)|
    | 1 | NESTED LOOPS | | 1 | 34 | 4 (0)|
    |* 2 | INDEX FAST FULL SCAN| SYS_C008798 | 1 | 15 | 4 (0)|
    |* 3 | INDEX UNIQUE SCAN | SYS_C008803 | 1 | 19 | 0 (0)|
    Predicate Information (identified by operation id):
    2 - filter(UPPER("B"."ZONECODE")='SZ-4' AND UPPER("B"."MRNO")='347'
    AND UPPER("B"."AREACODE")='18' AND UPPER("B"."WCNO")='30910')
    3 - access("B"."ZONECODE"="C"."ZONECODE" AND "B"."MRNO"="C"."MRNO"
    AND "B"."AREACODE"="C"."AREACODE" AND "B"."WCNO"="C"."WCNO")
    Note
    - 'PLAN_TABLE' is old version

    Welcome to the forums!
    user13295080 wrote:
    I was trying to get an explain plan for below query. (Refer - A)
    BILL_DETAIL table have index of ZONECODE,MRNO,AREACODE,WCNO but still it's
    showing 'TABLE ACCESS FULL in BILL_DETAIL'
    If i select only first 4 column, it is going by index. (REFER - B)
    As per my knowledge index will consider only where clause conditions
    but here I couldn't understand why this considering select output columns.This is because Oracle is smart enough to know that the entire query can be satisfied by using the index without hitting the table. However, once you add a column that doesn't exist in the index Oracle has decided it is more efficient to use the full table scan.
    I also noticed that all the row estimates are 1 in the execution plans. Is this expected? If not, have statistics on the relevant objects been gathered?
    Generally speaking, when you have a query tuning question providing information in these threads is extremely helpful:
    {message:id=1812597}
    {thread:id=863295}
    Additionally, when posting query plans, queries, or any code please use \ tags to preserve formatting.
    Your code here!\                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Sql Explain Plan

    Hi Guys
    I am new to SQL Tuning and i wanna know what exactly are the tables involved in finding the explain plan of sql's and what all the views that needs to be queried to find the explain lan of a query. Kindly help me .
    Thanks
    Ram

    plan_table is used to get execution plan of any query. this table can be created with the script utlxplan.sql. You can find the script under ORACLE_HOME/rdbms/admin folder.
    The process for getting the execution plan is
    SQL> explain plan for
    2 select * from emp where employee_id=12 ;
    Explained.
    SQL> select plan_table_output from table(dbms_xplan.display('plan_table',null,'serial'));
    you can run the utlxpls.sql script also to get formated output and which can be found in ORACLE_HOME/rdbms/admin folder.
    PLAN_TABLE_OUTPUT
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU) |
    | 0 | SELECT STATEMENT | | 1 | 42 | 3 (0)|
    |* 1 | TABLE ACCESS FULL | EMP | 1 | 42 | 3 (0)|
    Predicate Information (identified by operation id):
    PLAN_TABLE_OUTPUT
    1 - filter("EMPLOYEE_ID"=12)

  • Tuning needed for sql:EXPLAIN PLAN attached

    DB Version:10gR2
    The below sql was running slow, so i took an explain plan
    SQL> explain plan for
      2  SELECT COUNT(1) FROM SHIP_DTL WHERE
      3  SHIP_DTL.PLT_ID = 'AM834'
      4  AND SHIP_DTL.WHSE = '34' AND
      5  SHIP_DTL.STAT_CODE != '845'
      6  ORDER BY SHIP_DTL.LOAD_SEQ ASC;
    Explained.
    SQL> select * from table(dbms_xplan.display);
    PLAN_TABLE_OUTPUT
    | Id  | Operation                    |  Name             | Rows  | Bytes | Cost (%CPU)|
    |   0 | SELECT STATEMENT             |                   |     1 |    18 |     5  (20)|
    |   1 |  SORT AGGREGATE              |                   |     1 |    18 |            |
    |*  2 |   TABLE ACCESS BY INDEX ROWID| SHIP_DTL        |   200 |  3600 |     5  (20)|
    |*  3 |    INDEX RANGE SCAN          | SHIP_DTL_IND_4  |   203 |       |     3   (0)|
    Predicate Information (identified by operation id):
    PLAN_TABLE_OUTPUT
       2 - filter("SHIP_DTL"."WHSE"='34' AND "SHIP_DTL"."STAT_CODE"<>845)
       3 - access("SHIP_DTL"."PLT_ID"='AM834')Why is there an INDEX RANGE scan where there is no BETWEEN operator in the query? What are various options(indexes, rewriting query) in tuning this query?

    james_p wrote:
    DB Version:10gR2
    The below sql was running slow, so i took an explain planCheck your plan, the optimizer estimates that the following query:
    select count(*)
    from SHIP_DTL
    where "SHIP_DTL"."PLT_ID"='AM834';only returns 200 records. Is this correct? Please post the result of above query.
    It probably isn't the case, because retrieving 200 records per index range scan and single row random table access shouldn't take long, at maximum a couple of seconds if you need to read each block actually from disk rather than from the cache.
    If the estimate is wrong you need to check the statistics on the table and index that were used by the optimizer to come to that conclusion.
    Are you sure that this plan is the actual plan used at execution time? You can check for the actual plans used to execute by using the DBMS_XPLAN.DISPLAY_CURSOR function in 10g if the SQL is still cached in the Shared Pool. You need to pass the SQL_ID and SQL_CHILD_NUMBER which you can retrieve from V$SESSION while the statement is executing.
    Regards,
    Randolf
    Oracle related stuff blog:
    http://oracle-randolf.blogspot.com/
    SQLTools++ for Oracle (Open source Oracle GUI for Windows):
    http://www.sqltools-plusplus.org:7676/
    http://sourceforge.net/projects/sqlt-pp/

  • ODI IKM SQL to Planning Issue

    Can anyone help me out with this one? I'm trying to run an IKM to Planning to update a Planning dimension metadata outline and am using the IKM SQL to Planning. After executing it, the Operator shows the status completed but an exception occured from one of the steps, "Report Statistics". I'm using the Sunopsis_Memory_Engine as my staging area and my flow chart start with a flat file (LKM File to SQL), staging area Sunopsis, and target is Planning (IKM SQL to Planning). In my mapping diagram, I have all columns to execute on the staging area, except for the parent and child columns which I have executing on the source. Below is the execution message for the "Report Statistics" step that seems to fail. Anyone know how to address this?
    org.apache.bsf.BSFException: exception from Jython:
    Traceback (innermost last):
    File "<string>", line 2, in ?
    Planning Writer Load Summary:
         Number of rows successfully processed: 0
         Number of rows rejected: 237
         at org.apache.bsf.engines.jython.JythonEngine.exec(JythonEngine.java:146)
         at com.sunopsis.dwg.codeinterpretor.k.a(k.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.scripting(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execScriptingOrders(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execScriptingOrders(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSqlI.treatTaskTrt(SnpSessTaskSqlI.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java)
         at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandSession.treatCommand(DwgCommandSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandBase.execute(DwgCommandBase.java)
         at com.sunopsis.dwg.cmd.e.i(e.java)
         at com.sunopsis.dwg.cmd.g.y(g.java)
         at com.sunopsis.dwg.cmd.e.run(e.java)
         at java.lang.Thread.run(Unknown Source)

    Hi,
    Have you also enabled the error logs in the IKM as this log should also explain why they are being rejected.
    In the operator a failure is a red icon, the icons you are pointing out are yellow, they may be an error but they are not serious, for instance it tries to drop a table if it doesn't exist it warns and carries on, if the table existed it would drop it, these are not serious failures, ones to be concerned about are red.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • SQL Explain Plan tutorial links

    Hello experts
    I don't know anything about sql explain plan. I would like to learn it. I read several Oracle documents However I don't understand clearly. Do you know any article or powerpoint related to sql explain plan basics for beginners?
    Thanks a lot for your help.

    944258 wrote:
    Hello experts
    I don't know anything about sql explain plan. I would like to learn it. I read several Oracle documents However I don't understand clearly. Do you know any article or powerpoint related to sql explain plan basics for beginners?
    Thanks a lot for your help.http://www.lmgtfy.com/?q=oracle+explain+plan+tutorial

  • How to get the SQL Execution Plan from complex Extractors ?

    Hi
    I am looking for a way to get  the
    SQL Execution Plan(s!) 
    from
    Complex Extractors like 0CO_OM_CCA_9 ?
    Anybody has got a suggestion ?
    How to get this in SM50 ?
    ThanXs
    Martin

    Identifying the query is the hard part. If you can identify it(based on table access or some such parameter, getting the execution plan is easy in ST04 .

  • How to find out if SQL execution plan is changed proactively using job/grid

    Hello,
    Can you help me on How to find out if SQL execution plan is changed proactively using job/grid control?
    Thank you..
    -

    The answers so far are supposed to show ways how to see that a plan changed after the fact - that is not really proactive but that was the question.
    A way to see a plan change proactively would be to create a SQL Plan Baseline for the SQL statement with the 'good old' plan and then watch DBA_SQL_PLAN_BASELINES for new rows with that SQL_HANDLE which would indicate that a new execution plan was computed - although not yet used.
    Kind regards
    Uwe Hesse
    "Don't believe it, test it!"
    http://uhesse.com

  • Does SQL developer plan to support TFS?

    our developing team uses MS Team Foundation Server as our primary source control / version control software. Does SQL developer planning to give a plug-in to support this? The PL/SQL developer could let us us MSSCCI provider to connect to TFS, I would like to know if Oarcle's SQL developer support the same.
    Thanks!

    Although unlikely, you can always request this at the SQL Developer Exchange, so other users can vote and add weight for possible future implementation.
    Regards,
    K.

  • SQL maintenance plan job problem - cannot remove a job

    Hi,
    I have a SQL 2008 R2 server running SP2. I changed the start time  to hour A on a maintenance job under maintenance plan, a few weeks later I changed it back (hour B). The maintenance job still runs at the changed start time (hour A). I even completly
    deleted the job, and I do not see that job under SQL maintenance plan and agent job anymore.  But somehow SQL still tries to start the job at the changed time (hour A), and sends out error messages saying the job fails. 
    I have restarted the entire server also. Same issue.
    The job is not a special one. Just a db index optimize script that ran fine within the maintenance job before I changed the time. Actually, now I just set it up as a SQL agent job, not a maintenance job, and it runs fine. 
    Any advice?
    Thanks in advance.

    Martians!  That is the sign of computer invasion by martians!
    Did you try to delete the maintenance plan (not the job!) and recreate it?
    The following query may be helpful:
    select * from msdb.dbo.sysjobschedules ORDER BY job_id;
    schedule_id job_id next_run_date next_run_time
    1 1016 28EC0B2D-6BA2-4CC7-B99C-03DF945A3763 20140121 124000
    2 1013 ED3E89DF-0ED6-4D1B-9A6E-100E04412E2B 20140120 32700
    Kalman Toth Database & OLAP Architect
    SQL Server 2014 Database Design
    New Book / Kindle: Beginner Database Design & SQL Programming Using Microsoft SQL Server 2014

  • How to write SQL in crystal report that can reuse SQL execution plan cache?

    I write the following SQL with crystal report parameter fields, and it is connecting to SQL 2005
    Select Name from Customer where CustID = '{?CustID}'
    The SQL profiler show that It is an ad-hoc query, how to write parameterized SQL which can reuse Execution Plan.
    Edited by: Chan Yue Wah on May 14, 2009 3:17 AM

    Since there are too many report, it is not possible rewrite all. Is that crystal report do not have option to change how it query the database ?

  • Sql execution plan

    There was a query to create the execution plan for owner name.view name
    i know to generate the explain plan for sql query using
    explain plan for <sql query>
    whereas how to generate the execution plan for owner name.view name using explain plan.
    Please explain and guide me in this
    Aram

    aram wrote:
    There was a query to create the execution plan for owner name.view name
    i know to generate the explain plan for sql query using
    explain plan for <sql query>
    whereas how to generate the execution plan for owner name.view name using explain plan.
    Please explain and guide me in this
    Aramexplain plan for SELECT * FROM OWNER_NAME.VIEW;

  • SQL Maintnence Plan for RTCLocal Instance

    Hello,
    I had a question come up from a DBA regarding the SQL Express Instances on the Lync Front End Servers.  He asked about a suggested maintenance plan.  While SQL Express has no maintenance wizard of course, maintenance can still be scripted. 
    I was not able to find any best practices for maintenance on the RTCLocal/Lynclocal instances on the Front Ends.
    Can anyone shed any light on if standard maintenance for SQL databases would be advisable or not and why?

    I just leave it alone, it takes care of itself pretty well.  I do use Lasse's backup script with some slight modifications which does perform a scripted backup however. 
    https://gallery.technet.microsoft.com/Backup-script-for-Lync-2013-aacbb9b9
    But I have clients with Lync 2010 servers in production for four years without real issue.
    Please remember, if you see a post that helped you please click "Vote As Helpful" and if it answered your question please click "Mark As Answer".
    SWC Unified Communications
    This forum post is based upon my personal experience and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

  • SQL Query Plan BUG

    Hi all I am looking at the Query plan of a store proc. I found a very strange situation:
    There is an index seek of a table which DOES NOT query inside the SP..how does it happen~?
    i search around the SP , no where I can find a word related to that table. (Actually the table and index is really there inside the database!!!! )
    I am using SQL 2008 R2 SP2, Standard version.Help.

    I this perhaps an INSERT statement?  In that case, the target table might have a foreign key constraint that references another table so the plan includes a seek to enforce the constraint.
    Dan Guzman, SQL Server MVP, http://www.dbdelta.com

  • SQL  - Multiple plan baselines

    Dear Experts,
    I created a SQL plan baseline for one of the problematic SQL's yesterday and am seeing multiple sql plan baselines are getting created and are all enabled for this SQL ID.
    I would like to understand why there are so many plan baselines created? how to get rid of them?
    Thanks for your help!

    Hi,
    If intended to stop the collection of sql base lines kindly check the parameter "optimizer_capture_sql_plan_baselines" whether to enable based on your query execution with different bind variable inputs.
    - Thanks
    Pavan Kumar N

Maybe you are looking for

  • Imac runs slow  beach ball all the time, imac runs slow  beach ball all the time

    can any one help imac runs very slow and every click the beach ball is at hand  is this thing going to crash

  • Uploading Contacts/Calander FROM the ipod

    Hi all, Hoping someone can help me, been looking at the posts but can't find one that totally answers my question. I have backed up all my contact and calander details to my ipod regularlly, though the other day I foolishly deleted them from ical and

  • Spark ComboBox new item does not display in textInput?

    I've been playing with s:ComboBox and generally like them a lot. One detail is driving me nuts though - most likely due to my lack of knowledge in the subject - is that if I try to add a new item to my dataprovider in a changeHandler (registered to t

  • Select tool and Tab randomly stop working

    When filling in a form in Reader, the select tool and Tab between fields feature sometimes stop working at random. Right clicking the field and then left clicking (not on Paste menu) seems to work to allow writing in the field again. Sometimes this a

  • Link to Dynamic Layout Record - Task

    Hi All, I have added a link from our activity report in to the task record. We use the dynamic layout quite a bit with the task record, however when drill down into the record from the report, Siebel displays the standard layout instead of the actual