Query tunning in Oracle using Explain Plan

Adding to my below question: I have now modified the query and the path shownby 'Explain plan' has reduced. The 'Time' column of plan_table is also showing much lesser value. However, some people are suggesting me to consider the time required by the query to execute on Toad. Will it be practical? Please help!!
Hi, I am using Oracle 11g. I need to optimize a Select query(Need to minimize the execution time). I need to know how 'Explain Plan' would help me. I know how to use Explain Plan command. I refer Plan_table table to see the details of the plan. Please guide me regarding which columns of the Plan_table should be considered while modifying the query for optimization. Some people say, 'Time' column should be considered, some say 'Bytes' etc. Some suggest on minimizing the full table scans, while some people say that I should minimize the total no. operations (less no. of rows should be displayed in Plan_table). As per an experienced friend of mine, full table scans should be reduced (for e.g. if there are 5 full table scans in the plan, then try to reduce them to less than 5. ). However, if I consider any full table scan operation in the plan_table, its shows value of 'time' column as only 1 which is very very less. Does this mean the full scan is actually taking very less time?? If yes, then this means full table scans are very fast in my case and no need to work on them. Some articles suggest that plan shown by 'Explain Plan' command is not necessarily followed while executing the query. So what should I look for then? How should I optimize the query and how will I come to know that it's optimized?? Please help!!...
Edited by: 885901 on Sep 20, 2011 2:10 AM

885901 wrote:
Hi, I am using Oracle 11g. I need to optimize a Select query(Need to minimize the execution time). I need to know how 'Explain Plan' would help me. I know how to use Explain Plan command. I refer Plan_table table to see the details of the plan. Please guide me regarding which columns of the Plan_table should be considered while modifying the query for optimization. Some people say, 'Time' column should be considered, some say 'Bytes' etc. Some suggest on minimizing the full table scans, while some people say that I should minimize the total no. operations (less no. of rows should be displayed in Plan_table). As per an experienced friend of mine, full table scans should be reduced (for e.g. if there are 5 full table scans in the plan, then try to reduce them to less than 5. ). However, if I consider any full table scan operation in the plan_table, its shows value of 'time' column as only 1 which is very very less. Does this mean the full scan is actually taking very less time?? If yes, then this means full table scans are very fast in my case and no need to work on them. Some articles suggest that plan shown by 'Explain Plan' command is not necessarily followed while executing the query. So what should I look for then? How should I optimize the query and how will I come to know that it's optimized?? Please help!!...how fast is fast enough?

Similar Messages

  • Tunning using EXPLAIN PLAN

    HI,
    I am trying to do EXPLAIN PLAN. But SP HAS SO MANY PARAMETER declaration, its very difficult to run explain for each select statement.
    Can any one help me how to run explain paln.

    885901 wrote:
    Hi, I am using Oracle 11g. I need to optimize a Select query(Need to minimize the execution time). I need to know how 'Explain Plan' would help me. I know how to use Explain Plan command. I refer Plan_table table to see the details of the plan. Please guide me regarding which columns of the Plan_table should be considered while modifying the query for optimization. Some people say, 'Time' column should be considered, some say 'Bytes' etc. Some suggest on minimizing the full table scans, while some people say that I should minimize the total no. operations (less no. of rows should be displayed in Plan_table). As per an experienced friend of mine, full table scans should be reduced (for e.g. if there are 5 full table scans in the plan, then try to reduce them to less than 5. ). However, if I consider any full table scan operation in the plan_table, its shows value of 'time' column as only 1 which is very very less. Does this mean the full scan is actually taking very less time?? If yes, then this means full table scans are very fast in my case and no need to work on them. Some articles suggest that plan shown by 'Explain Plan' command is not necessarily followed while executing the query. So what should I look for then? How should I optimize the query and how will I come to know that it's optimized?? Please help!!...how fast is fast enough?

  • Using explain plan

    Hi,
    I am quite new to use explain plan in oracle.
    I want to know what are the important factors that we should emphasize to optimize a SQL query.
    Thanks in Advance,
    Dilip

    If I had to identify key SQL tuning factors to look for in relation to an explain plan I would say that number one is to verify that the plan is driving on the right tables in the proper order.
    Second looking at the SQL make sure it is not written in such a manner as to disable the use of available indexes such as when a trunc is done on an indexed date column so it can be compared equal to another date when a >= date value of midnight and < midnight of first day not desired could be used instead enabling use of the index on the date column by the optimizer. Implicit conversions of join column data types can also disable use of an index.
    Third, if the CBO is doing something other than what you expected do not just assume it is wrong. Try to figure out why it is doing what it is doing and then try to determine if it is right or wrong. I have caught people trying to tune SQL because they knew the plan was wrong, but did not actually test it before spending a lot of time to develop a different path that ran slower than the optimzer plan.
    HTH -- Mark D Powell --

  • Used Explain Plan

    Hi,
    on 11.2.0.3 , I use the following to verify the Explain Plan used for an executed query.
    SELECT * FROM
    TABLE(DBMS_XPLAN.DISPLAY_AWR('<sql_id>','<plan_hash>'));
    For example
    SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY_AWR('cx8m90z5n57g1','3867296312'));
    The problem is that it does not bring always back a result to display . Every now and then it does not find any Explain Plan. Why ?
    Any other way that let to find Used Explain Plan for sure ?
    Thanks and regards.

    The problem is that it does not bring always back a result to display . Every now and then it does not find any Explain Plan. Why ?
    Because the statemen didn't qualify according to the thresholds of thw AWR or was already removed from the AWR.
    Any other way that let to find Used Explain Plan for sure ?
    Definitely. And anyone providing DBMS_XPLAN examples as search string in Google would have been able to find them.
    Sybrand Bakker
    Senior Oracle DBA

  • ERROR: insufficient privileges while using EXPLAIN PLAN command

    Hi,
    I have a table named TEST and i ran following command on this table.
    SQL> EXPLAIN PLAN FOR
    2 SELECT NAME FROM TEST;
    SELECT NAME FROM TEST
    ERROR at line 2:
    ORA-01031: insufficient privileges
    So which privilege do i need to give for using EXPLAIN PLAN command.
    Thank.

    http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14211/ex_plan.htm#i19260
    SQL> @C:\oracle\product\10.2.0\db_1\RDBMS\ADMIN\utlxplan.sql
    Table created.
    SQL> select table_name from user_tables where table_name='PLAN_TABLE';
    TABLE_NAME
    PLAN_TABLE
    You might consider checking dba_tables to check the owner in your case and may be you don't privilege on that table.

  • Query off of Oracle using WinSql - Need help with query

    I am trying to query off of Oracle using program WinSql.
    I have a table(tticpr200110) that has the following sample data:
    ITEM     CODE     T$AMNT
    23500076 ACL     .0049
    23500076 APM     0
    23500076 APO     .0093
    23500076 EXP     .0001
    23500076 RES     .0072
    and what I want it to look like is:
    ITEM     ACL     APM     APO     EXP     RES
    23500076     0.0049     0     0.0093     0.0001     0.0072
    (actually I need the last 2 columns added together to be MATL-but can deal with that down the road).
    Seems simple enough, but I don't know to put into the columns.
    Any help would be GREATLY appreciated as soon as possible would be even better.

    My table - tticpr200110 when it runs I get the following sample data for part number 23500076:
    The first coloumn ITEM is the part number.
    The second column CODE is 1 of 5 different cost codes
    The third column is the cost for that code for that part.
    ITEM CODE AMNT
    23500076 ACL 0.0049
    23500076 APM 0.0000
    23500076 APO 0.0093
    23500076 EXP 0.0001
    23500076 RES 0.0072
    I want to make a query that makes the data look like this:
    ITEM ACL APM APO EXP RES
    23500076 0.0049 0.0000 0.0093 0.0001 0.0072
    (similar to a pivot table in excel or acess)
    I hope this helps better.
    Thanks!

  • Not able to use EXPLAIN PLAN in Toad

    hi,
    I am not able to use Explain Plan in Toad. The error it gives is the table PLAN_TABLE doesn't exit.
    But after seeing this error I did run the script "UTLXPLAN.sql" in order to create the plan_table table.
    After installing the above table I am not able to use EXPLAIN_PLAN from toad, Its giving same error Table PLAN_TABLE doesn't exit though i created it successfully in the proper schema.
    Thanks in advance
    Ram

    check and post.
    SQL> select owner from dba_tables where table_name='PLAN_TABLE';
    before using toad ,first u should connect to sqlplus by that user and issue
    SET AUTOTRACE ON.
    Kuljeet

  • Why bother to use explain plan?

    All my colleagues used the third party applications, Crystal Report or TAOD, to query data from the 10g R2 database for some kind of reporting. The problem is they always created the query with multiple outer join (> 10 tables) and they WRITE the codes without using the explain plan. They simply used the query for result of the moment and the query they wrote only were used for few time (< 3), because the manager requested the report kept changing the requirement. They did it on both Dev and Prod
    I think it is bad practice, how can I convience them to change their practice?

    The concept that something is ad hoc and therefore doesn't matter can break down pretty quickly when a bright light is shined upon it. But what you are fighting here is more a question of politics than technology.
    If the system is still chugging along at an acceptable speed, no end-user complaints, and practices in your organization range from sloppy to lazy you should probably just polish up your resume and move to a job where people care about professional standards and doing a good job.
    To change a practice such as this usually one must get to the level of childish schoolyard play and create a competitive atmosphere. Take one of those slow queries and tune it. Challenge someone to do better than you did. Offer a beer to anyone that can write it more efficiently than you did, etc. Make it a game.
    But don't be surprised if the reason they aren't running explain plan is that:
    1. They don't know how
    2. They know how but don't know how to read the output
    3. They know how to read the output but haven't a clue what to do about it.
    As an example ... I know a lot of people that think they know how to output an explain plan. In truth not 10% of them understand this:
    SELECT * FROM TABLE(dbms_xplan.display_cursor('cpm9ss48qd32f', 0));
    http://www.psoug.org/reference/dbms_xplan.html
    Which is really rather sad.

  • [8i] Can someone help me on using explain plan, tkprof, etc.?

    I am trying to follow the instructions at When your query takes too long ...
    I am trying to figure out why a simple query takes so long.
    The query is:
    SELECT COUNT(*) AS tot_rows FROM my_table;It takes a good 5 minutes or so to run (best case), and the result is around 22 million (total rows).
    My generic username does not (evidently) allow access to PLAN_TABLE, so I had to log on as SYSTEM to run explain plan. In SQL*Plus, I typed in:
    explain plan for (SELECT COUNT(*) AS tot_rows FROM my_table);and the response was "Explained."
    Isn't this supposed to give me some sort of output, or am I missing something?
    Then, the next step in the post I linked is to use tkprof. I see that it says it will output a file to a path specified in a parameter. The only problem is, I don't have access to the db's server. I am working remotely, and do not have any way to remotely (or directly) access the db server. Is there any way to have the file output to my local machine, or am I just S.O.L.?

    SomeoneElse used "create table as" (CTAS), wich automatically gathers the stats. You can see the differende before and after stats clearly in this example.
    This is the script:
    drop table ttemp;
    create table ttemp (object_id number not null, owner varchar2(30), object_name varchar2(200));
    alter table ttemp add constraint ttemp_pk primary key (object_id);
    insert into ttemp
    select object_id, owner, object_name
    from dba_objects
    where object_id is not null;
    set autotrace on
    select count(*) from ttemp;
    exec dbms_stats.gather_table_stats('PROD','TTEMP');
    select count(*) from ttemp;And the result:
    Table dropped.
    Table created.
    Table altered.
    46888 rows created.
      COUNT(*)
         46888
    1 row selected.
    Execution Plan
               SELECT STATEMENT Optimizer Mode=CHOOSE
       1         SORT AGGREGATE
       2    1      TABLE ACCESS FULL PROD.TTEMP
    Statistics
              1  recursive calls
              1  db block gets
            252  consistent gets
              0  physical reads
            120  redo size
              0  PX remote messages sent
              0  PX remote messages recv'd
              0  buffer is pinned count
              0  workarea memory allocated
              4  workarea executions - optimal
              1  rows processed
    PL/SQL procedure successfully completed.
      COUNT(*)
         46888
    1 row selected.
    Execution Plan
               SELECT STATEMENT Optimizer Mode=CHOOSE (Cost=4 Card=1)
       1         SORT AGGREGATE (Card=1)
       2    1      INDEX FAST FULL SCAN PROD.TTEMP_PK (Cost=4 Card=46 K)
    Statistics
              1  recursive calls
              2  db block gets
            328  consistent gets
              0  physical reads
           8856  redo size
              0  PX remote messages sent
              0  PX remote messages recv'd
              0  buffer is pinned count
              0  workarea memory allocated
              4  workarea executions - optimal
              1  rows processed

  • Query Performance and reading an Explain Plan

    Hi,
    Below I have posted a query that is running slowly for me - upwards of 10 minutes which I would not expect. I have also supplied the explain plan. I'm fairly new to explain plans and not sure what the danger signs are that I should be looking out for.
    I have added indexes to these tables, a lot of which are used in the JOIN and so I expected this to be quicker.
    Any help or pointers in the right direction would be very much appreciated -
    SELECT a.lot_id, a.route, a.route_rev
    FROM wlos_owner.tbl_current_lot_status_dim a, wlos_owner.tbl_last_seq_num b, wlos_owner.tbl_hist_metrics_at_op_lkp c
    WHERE a.fw_ver = '2'
    AND a.route = b.route
    AND a.route_rev = b.route_rev
    AND a.fw_ver = b.fw_ver
    AND a.route = c.route
    AND a.route_rev = c.route_rev
    AND a.fw_ver = c.fw_ver
    AND a.prod = c.prod
    AND a.lot_type = c.lot_type
    AND c.step_seq_num >= a.step_seq_num
    PLAN_TABLE_OUTPUT
    Plan hash value: 2447083104
    | Id  | Operation           | Name                       | Rows  | Bytes | Cost
    (%CPU)| Time     |
    PLAN_TABLE_OUTPUT
    |   0 | SELECT STATEMENT    |                            |   333 | 33633 |  1347
       (8)| 00:00:17 |
    |*  1 |  HASH JOIN          |                            |   333 | 33633 |  1347
       (8)| 00:00:17 |
    |*  2 |   HASH JOIN         |                            |   561 | 46002 |  1333
       (7)| 00:00:17 |
    |*  3 |    TABLE ACCESS FULL| TBL_CURRENT_LOT_STATUS_DIM | 11782 |   517K|   203
       (5)| 00:00:03 |
    PLAN_TABLE_OUTPUT
    |*  4 |    TABLE ACCESS FULL| TBL_HIST_METRICS_AT_OP_LKP |   178K|  6455K|  1120
       (7)| 00:00:14 |
    |*  5 |   TABLE ACCESS FULL | TBL_LAST_SEQ_NUM           |  8301 |   154K|    13
      (16)| 00:00:01 |
    PLAN_TABLE_OUTPUT
    Predicate Information (identified by operation id):
       1 - access("A"."ROUTE"="B"."ROUTE" AND "A"."ROUTE_REV"="B"."ROUTE_REV" AND
                  "A"."FW_VER"=TO_NUMBER("B"."FW_VER"))
       2 - access("A"."ROUTE"="C"."ROUTE" AND "A"."ROUTE_REV"="C"."ROUTE_REV" AND
                  "A"."FW_VER"="C"."FW_VER" AND "A"."PROD"="C"."PROD" AND "A"."LOT_T
    YPE"="C"."LOT_TYPE")
           filter("C"."STEP_SEQ_NUM">="A"."STEP_SEQ_NUM")
       3 - filter("A"."FW_VER"=2)
    PLAN_TABLE_OUTPUT
       4 - filter("C"."FW_VER"=2)
       5 - filter(TO_NUMBER("B"."FW_VER")=2)
    24 rows selected.

    Guys thank you for your help.
    I changed the type of the offending column and the plan looks a lot better and results seem a lot quicker.
    However I have added to my SELECT, quite substantially, and have a new explain plan.
    There are two sections in particular that have a high cost and I was wondering if you seen anything inherently wrong or can explain more fully what the PLAN_TABLE_OUTPUT descriptions are telling me - in particular
    INDEX FULL SCAN
    PLAN_TABLE_OUTPUT
    Plan hash value: 3665357134
    | Id  | Operation                        | Name                           | Rows
      | Bytes | Cost (%CPU)| Time     |
    PLAN_TABLE_OUTPUT
    |   0 | SELECT STATEMENT                 |                                |
    4 |   316 |    52   (2)| 00:00:01 |
    |*  1 |  VIEW                            |                                |
    4 |   316 |    52   (2)| 00:00:01 |
    |   2 |   WINDOW SORT                    |                                |
    4 |   600 |    52   (2)| 00:00:01 |
    |*  3 |    TABLE ACCESS BY INDEX ROWID   | TBL_HIST_METRICS_AT_OP_LKP     |
    1 |    71 |     1   (0)| 00:00:01 |
    PLAN_TABLE_OUTPUT
    |   4 |     NESTED LOOPS                 |                                |
    4 |   600 |    51   (0)| 00:00:01 |
    |   5 |      NESTED LOOPS                |                                |    7
    5 |  5925 |    32   (0)| 00:00:01 |
    |*  6 |       INDEX FULL SCAN            | UNIQUE_LAST_SEQ                |    8
    9 |  2492 |    10   (0)| 00:00:01 |
    |   7 |       TABLE ACCESS BY INDEX ROWID| TBL_CURRENT_LOT_STATUS_DIM     |
    PLAN_TABLE_OUTPUT
    1 |    51 |     1   (0)| 00:00:01 |
    |*  8 |        INDEX RANGE SCAN          | TBL_CUR_LOT_STATUS_DIM_IDX1    |
    1 |       |     1   (0)| 00:00:01 |
    |*  9 |      INDEX RANGE SCAN            | TBL_HIST_METRIC_AT_OP_LKP_IDX1 |    2
    9 |       |     1   (0)| 00:00:01 |
    PLAN_TABLE_OUTPUT
    Predicate Information (identified by operation id):
       1 - filter("SEQ"=1)
       3 - filter("C"."FW_VER"=2 AND "A"."PROD"="C"."PROD" AND "A"."LOT_TYPE"="C"."L
    OT_TYPE" AND
                  "C"."STEP_SEQ_NUM">="A"."STEP_SEQ_NUM")
       6 - access("B"."FW_VER"=2)
           filter("B"."FW_VER"=2)
    PLAN_TABLE_OUTPUT
       8 - access("A"."ROUTE"="B"."ROUTE" AND "A"."ROUTE_REV"="B"."ROUTE_REV" AND "A
    "."FW_VER"=2)
       9 - access("A"."ROUTE"="C"."ROUTE" AND "A"."ROUTE_REV"="C"."ROUTE_REV")

  • Ora-01039 - Insuffficient priviliges - Tuning using Explain Plan

    In a TEST instance, i am trying (as the APPS user) on a 9.2.0.5 DB (11.5.10.2) trying to run an explain plan on a query but keep getting the 'ora-01039 - Insuffficient privileges on underlying objects of view' error message.
    I have granted 'select any dictionary' to both the APPS and APPLSYS users - but this does not seem to enable the explain plan to work.
    Could someone please shed some light on this?
    Tks

    You seem to be doin an Explain Plan on a query against a custom view against non-Apps objects.
    Explain Plan needs to be able to "see" the underlying tables (in that other schema).
    See :
    SQL> create view his_cntry_vw as select * from my_cntry;
    View created.
    SQL> grant select on his_cntry_vw to abc;
    Grant succeeded.
    SQL> connect abc/abc
    Connected.
    SQL> create synonym his_cntry_vw for otheruser.his_cntry_vw;
    Synonym created.
    SQL> select * from his_cntry_vw;
    GRP_I CNTRY
    ABC   Z9
    XYZ   UK
    SQL> explain plan for select * from his_cntry_vw;
    explain plan for select * from his_cntry_vw
    ERROR at line 1:
    ORA-01039: insufficient privileges on underlying objects of the view
    SQL> REM  THIS IS THE FIX :
    SQL> connect otheruser/otheruser
    Connected.
    SQL> grant select on my_cntry to abc;
    Grant succeeded.
    SQL> connect abc/abc
    Connected.
    SQL> explain plan for select * from his_cntry_vw;
    Explained.
    SQL>Hemant K Chitale
    http://hemantoracledba.blogspot.com

  • Error  SP2-0027 while using explain plan

    I'm using explain paln command in order to get the tables
    acceeded by a SQL query.
    When I use the command with some of them, that's OK.
    But when I use it with a query of 4999 characters, it gives me
    this error message:
    SP2-0027: Input is too long (> 2499 characters) - line ignored
    Has anybody an idea to solve this problem or to change this
    limit of 2499?

    user12043927 wrote:
    Open the file (or copy the sql) in a text editor and then resave the file as a different file type.
    In Microsoft Word, you click on File, Save As, then select file type 'text only with line breaks' and save the file. Once this is done, you can successfully run the script from SQL*Plus or Server Manager.You never get a second chance for your first impression.
    As your first post you resurrect a ten year dead zombie post.
    SWEET!
    Can you find a post that is older & dormant to boost your post count?

  • COLUMN WIDTH USING EXPLAIN PLAN

    I set autotrace on and when it displays the Execution Plan it wrap and is quite annoying. Is there a command so it will not wrap, but still display all the output?

    You misunderstood, this it what it look like
    Execution Plan
       0      SELECT STATEMENT Optimizer=CHOOSE (Cost=1 Card=1 Bytes=62)
       1    0   FILTER
       2    1     TABLE ACCESS (FULL) OF 'NEW_TRAINING_REQUIREMENT' (Cost=
              1 Card=1 Bytes=62)
       3    1     NESTED LOOPS (Cost=12 Card=6 Bytes=210)
       4    3       MERGE JOIN (CARTESIAN) (Cost=6 Card=6 Bytes=168)
       5    4         NESTED LOOPS (Cost=2 Card=1 Bytes=18)
       6    5           TABLE ACCESS (BY INDEX ROWID) OF 'CORP_TESTERS' (C
              ost=1 Card=1 Bytes=10)
       7    6             INDEX (UNIQUE SCAN) OF 'IDX_PK_CORP_TESTERS_1' (
              UNIQUE)
       8    5           TABLE ACCESS (FULL) OF 'FULLTIME_WORKER' (Cost=1 C
              ard=1 Bytes=8)
       9    4         SORT (JOIN) (Cost=5 Card=6 Bytes=60)
      10    9           TABLE ACCESS (FULL) OF 'NEW_PERSONAL' (Cost=4 Card
              =6 Bytes=60)
      11    3       TABLE ACCESS (BY INDEX ROWID) OF 'NEW_ORGANIZATION' (C
              ost=1 Card=348 Bytes=2436)
      12   11         INDEX (UNIQUE SCAN) OF 'IDX_PK_NEWORGANIZATION_1' (U
              NIQUE)But I would like for it to look like
    Execution Plan
       0      SELECT STATEMENT Optimizer=CHOOSE (Cost=1 Card=1 Bytes=62)
       1    0   FILTER
       2    1     TABLE ACCESS (FULL) OF 'NEW_TRAINING_REQUIREMENT' (Cost=1 Card=1 Bytes=62)
       3    1     NESTED LOOPS (Cost=12 Card=6 Bytes=210)
       4    3       MERGE JOIN (CARTESIAN) (Cost=6 Card=6 Bytes=168)
       5    4         NESTED LOOPS (Cost=2 Card=1 Bytes=18)
       6    5           TABLE ACCESS (BY INDEX ROWID) OF 'CORP_TESTERS' (Cost=1 Card=1 Bytes=10)
       7    6             INDEX (UNIQUE SCAN) OF 'IDX_PK_CORP_TESTERS_1' (UNIQUE)
       8    5           TABLE ACCESS (FULL) OF 'FULLTIME_WORKER' (Cost=1 Card=1 Bytes=8)
       9    4         SORT (JOIN) (Cost=5 Card=6 Bytes=60)
      10    9           TABLE ACCESS (FULL) OF 'NEW_PERSONAL' (Cost=4 Card=6 Bytes=60)
      11    3       TABLE ACCESS (BY INDEX ROWID) OF 'NEW_ORGANIZATION' (Cost=1 Card=348 Bytes=2436)
      12   11         INDEX (UNIQUE SCAN) OF 'IDX_PK_NEWORGANIZATION_1' (UNIQUE)If I set wrap off it cuts off what normally would appear in the second line

  • Question regarding using of Explain Plan

    Hi. I'm new with Oracle Queries so I have a little obstacles about understanding. I want to learn how to use Explain Plan feature from Oracle
    I am using Oracle 9i as back end .
    Please tell me how can i use feature of Explain Plan Feature for the below query.
    SELECT * FROM emp WHERE empno = 7369
    Thanks in advance.

    [email protected] wrote:
    Hi. I'm new with Oracle Queries so I have a little obstacles about understanding. I want to learn how to use Explain Plan feature from Oracle
    I am using Oracle 9i as back end .
    Please tell me how can i use feature of Explain Plan Feature for the below query.
    SELECT * FROM emp WHERE empno = 7369
    Kiran,
    Firstly , before anything else, I would suggest to change your handle to anything else and remove the email id from it. Its not good to have the id displayed in any public forum.
    About the question, unfortunately, its not that easy to answer. To understand explain plan and how to use it, you need to understand that algorithm/mechanism, whatever you feel like saying, that generates it. Because, explain plan is just the outcome of that mechanism, a final product, its the result of some inputs given by you in the form of your query, predicates, joins and their types and that all bring up the explain plan. Explain plan is basically the constitution of some steps which are used /fixed by optimizer to run the query. I would suggest that you read this page from cover to cover to understand some of the steps and their meanings which are shown to you in the plan. I am giving 10g link as this is a more better version of optimizer than the previous ones and I would suggest you to do experiments on 10g only.
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14211/optimops.htm#i21299
    And I would suggest that you collect these following books and start reading them. I haven't yet found any thing better than these books.
    [Cost Based Oracle Fundamentals (Jonathan Lewis)|http://www.amazon.com/Cost-Based-Oracle-Fundamentals-Experts-Voice/dp/1590596366]
    [Troubleshooting Oracle Performance(Christian Antognini )|http://www.amazon.com/Troubleshooting-Oracle-Performance-Christian-Antognini/dp/1590599179/ref=sr_1_1?ie=UTF8&s=books&qid=1240078634&sr=1-1]
    [Effectuve Oracle By Design(Tom Kyte)|http://www.amazon.com/Effective-Oracle-Design-Osborne-ORACLE/dp/0072230657/ref=sr_1_1?ie=UTF8&s=books&qid=1240078698&sr=1-1]
    It would be real long journey before the mazes of optimizer and explain would be clear so make sure you have patience as well.
    HTH
    Aman....

  • Oracle Hint not causing any change to explain plan

    Hi,
    I was facing a problem about ORA-00600 for using Connect by Prior query,
    details of which are at -
    Connect by Prior - ORA-00600: internal error code, arguments: [kkqcbydrv:1
    As is documented by Oracle, workaround for this is to use /*+ NO_UNNEST */ in query.
    I displayed the explain plan for original query and after putting hint in query.
    There is no difference in the explain plans, I am a starter for explain plans and don't know much of it.
    But shouldn't the hint cause some change in explain plan?
    Even the hash values as mentioned in explain plans are same.
    Thanks in advance.
    Av.

    Perhaps it would help if you put the query (with the hint) and the explain plan here.

Maybe you are looking for

  • Double-click in ALV Grid on BDC recording not recorded

    Hi, I'm recording a BDC session in a CRM system to enter a business partner.  One of the steps is to choose a marketing attribute.  To do this you have to double click on a (read only) ALV grid to select the attribute. When I record this in SHDB or L

  • Where to begin???

    We have had problems with this printer since we bought it, first it wouldnt print the right size picture, still cant copy an 8x10 and print it on a 8.5x11, it cut off some of the pic.  Now there is an error message that says load glossy side down, bu

  • Output type configuration for Purchase order

    Dear Friends, I want to configure output type for Purchase order in retail system and later want to trigger it in AFS(apparel, footwear solution) system. There is integration in IS retail and AFS system. I created a PO in IS retail system. Let me kno

  • How to show Movie subtitle

    Hi there,, i want to know how can i show a movie subtitle in apple TV i bought a movie from iTunes Store , and when i chose to show english subtitle from the main menu,, nothing happened any idea ?

  • Mac Pro and Dummy Terminals

    Here's my situation: currently my household has 6 people in it and we all have PC's, but we want to switch to apple. The problem is I would like to get the Mac Pro but cant afford 6 of them. I also cant have everyone share because that never seems to