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

Similar Messages

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

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

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

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

  • 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

  • Cell column width using spry horizontal menu

    Hi
    Trying to set the cell column width using DWCS5.5 Spry Horizontal menu.
    view-source:http://www.roatan.ws/spry-menu-bob
    I used help to get directions and I think I did it correctly but I do not know for sure.
    /* Menu item containers are same fixed width as parent */
    ul.MenuBarHorizontal ul li
              background-color: #356A68;
              float: none;
              background-color:transparent;
              height: auto;
              width: auto;
    Trying to clean up my site and get things working an looking right.
    Any suggestions appreciated
    bob

    Spry menus do not contain any table columns or cells.    They are just lists <ul> <li>  tags  styled with CSS.
    ul.MenuBarHorizontal li
        margin: 0;
        padding: 0;
        list-style-type: none;
        font-size: 12px;
        position: relative;
        text-align: center;
        cursor: pointer;
        width: 8em; /**adjust top-menu width**/
        float: left;
        text-decoration: underline;
    ul.MenuBarHorizontal ul
        margin: 0;
        padding: 0;
        list-style-type: none;
        font-size: 10px;
        z-index: 1020;
        cursor: default;
        width: 8em; /**adjust sub-menu width**/
        position: absolute;
        left: -1000em;
        background-color: #356A68;
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists 
    http://alt-web.com/
    http://twitter.com/altweb
    http://alt-web.blogspot.com/

  • 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

  • Time column of an explain plan

    Hi,
    I'm using Oracle version 10.2.0.3.0. I have 2 tables with 10 million records each. The DDL is as follows.
    create table bigtable(col1 varchar2(20), col2 varchar2(20))
    create table bigtablechild(col1 varchar2(20), col2 varchar(20))
    bigtablechild.col1 is a foreign key to bigtable.col1. Below is the query and explain plan. Over several executions, the query runs for about 20 seconds before returning results. Could anyone please explain what the time column represents? It doesn't match the time it took to return results.
    SQL> set autotrace on
    SQL>
    SQL> select b.col2
      2  from bigtable a, bigtablechild b
      3  where a.col1 = b.col1
      4  and a.col1 = 'ABC6554';
    COL2
    XYZ6554
    XYZ6554
    XYZ6554
    XYZ6554
    XYZ6554
    Execution Plan
    Plan hash value: 4210396901
    | Id  | Operation          | Name          | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT   |               |     5 |   150 | 21538   (4)| 00:04:19 |
    |*  1 |  HASH JOIN         |               |     5 |   150 | 21538   (4)| 00:04:19 |
    |*  2 |   TABLE ACCESS FULL| BIGTABLE      |     1 |    10 | 13124   (4)| 00:02:38 |
    |*  3 |   TABLE ACCESS FULL| BIGTABLECHILD |     5 |   100 |  8413   (5)| 00:01:41 |
    Predicate Information (identified by operation id):
       1 - access("A"."COL1"="B"."COL1")
       2 - filter("A"."COL1"='ABC6554')
       3 - filter("B"."COL1"='ABC6554')
    Statistics
              0  recursive calls
              0  db block gets
          93672  consistent gets
          91845  physical reads
              0  redo size
            463  bytes sent via SQL*Net to client
            396  bytes received via SQL*Net from client
              2  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
              5  rows processed

    Hi,
    the values in the TIME column are calculated from cost using system I/O statistics. If dbms_stats.gather_system_stats has never been run, then these stats have default values which may be very far from the truth. In your case, the optimizer expects a single-block I/O read to take about 12 ms, while in reality it is closer to 1 ms, thus the discrepancy between the prediction and actual results.
    In general, TIME column is not very helpful not just because of potentially incorrect I/O time estimates, but also because it is hard to predict how much data will be found in cash, so I would recommend not to pay too much attention to it (note, however, that A-time column, on the other hand, is extremely useful, but it's only available if rowsource statistics for the plan have been populated).
    Best regards,
    Nikolay

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

  • Setting column widths using CSS...

    Hi guys,
    I am using a simple 2 column table to layout pictures and
    text. The problem I'm having is that I'm not sure how to set the
    column widths and as such when you flick from page to page the
    column widths and don't stay exactly equal to each other as I'd
    like them too.
    This can clearly be seen through clicking and comparing the
    following two pages.
    http://www.fyrne.com/mb_food_and_drink.html
    http://www.fyrne.com/mb_television.html
    Any advice on how I can resolve this would be much
    appreciated.
    Cheers, J

    Hi James,
    I see the scrollbars now but now I also see what you mean :(
    I think the easy fix is to create a class and apply it to
    every single
    td that has the text/image/heading to give them a fixed
    width! (Maybe
    only applying it to the top td's would do the trick... I'm
    really no
    good with tables)
    Hope it made some sense
    JamesFryer skrev:
    > Hi Kim,
    >
    > Thanks for posting this link. I think it was Nadia who
    previously suggested I
    > implement the suggest edcode line to auto add the
    vertical scroll bar and avoid
    > an overall site shift problem I was having.
    >
    > However I have now implemented this and am still getting
    the shift problem -
    > you will notice it is not the overall site (ie the
    bordered area) which is
    > shifting but the internal table columns. I believe I
    have set these column
    > widths in DW design view but this often proves
    problematic (pushing out the
    > width of the main table for no reason although this does
    not actually show when
    > previewed).
    >
    > As such I hoped I would be able to control this through
    CSS - I don't believe
    > it's the same as the shifting problem...
    >
    > Thanks again, J
    >
    Kim
    http://www.geekministry.com

  • Understanding the COST column of an explain plan

    Hello,
    I executed the following query, and obtained the corresponding explain plan:
    select * from isis.clas_rost where cour_off_# = 28
    Description COST Cardinality Bytes
    SELECT STATEMENT, GOAL = FIRST_ROWS               2     10     1540
    TABLE ACCESS BY INDEX ROWID     ISIS     CLAS_ROST     2     10     1540
    INDEX RANGE SCAN     ISIS     CLAS_ROST_N2     1 10     
    I don't understand how these cost values add up. What is the significance of the cost in each row of the explain plan output?
    By comparison, here is another plan output for the following query:
    select * from isis.clas_rost where clas_rost_# = 28
    Description COST Cardinality Bytes
    SELECT STATEMENT, GOAL = FIRST_ROWS               1     1     154
    TABLE ACCESS BY INDEX ROWID     ISIS     CLAS_ROST     1     1     154
    INDEX UNIQUE SCAN     ISIS     CLAS_ROST_U1     1 1     
    Thanks!

    For the most part, you probably want to ignore the cost column. The cardinality column is generally what you want to pay attention to.
    Ideally, the cost column is Oracle's estimate of the amount of work that will be required to execute a query. It is a unitless value that attempts to combine the cost of I/O and CPU (depending on the Oracle version and whether CPU costing is enabled) and to scale physical and logical I/O appropriately). As a unitless number, it doesn't really relate to something "real" like the expected number of buffer gets. It is also determined in part by initialization parameters,session settings, system statistics, etc. that may artificially increase or decrease the cost of certain operations.
    Beyond that, however, cost is problematic because it is only as accurate as the optimizer's estimates. If the optimizer's estimates are accurate, that implies that the cost is reasonably representative (in the sense that a query with a cost of 200 will run in less time than a query with a cost of 20000). But if you're looking at a query plan, it's generally because you believe there may be a problem which means that you are inherently suspicious that some of the optimizer's estimates are incorrect. If that's the case, you should generally distrust the cost.
    Justin

  • Define column width using a variable

    Hi All,
    Is there a way to define the width of a specific column using a variable in an rtf template?
    I have a requirement that one column should fit it's (largest) content. Now my idea is to replace the static width in points with a variable, but seems to be impossible in MS Word.
    I've already tried to use split-column-width but then I also have to use split-column-header etc. which seems a bit excessive.
    Is there a way to do this nice and tidy?
    Kind regards,
    Machiel

    The script linked in this thread
    http://forums.adobe.com/thread/1115330
    can copy column widths; storing and retrieving them from a table style. The style won't apply the widths directly, but I have found it very useful.

  • How to adjust Column width using SHD0 for FB60

    Hi,
    How can adjust ( i have to reduce the length) Assignment filed in the FB60 transaction using SHD0.
    Please help in this regard.
    Regards,
    Kishore

    HI,
    I think you can adjust the column width and save it as Screen Variant in the SHD0.
    When you create a screen variant for the MIRO, adjust your column width and position than save it the variant. Once you save and activate the variant, it will appear in the Layout dropdown box on MIRO.
    OR
    Please check in spro with ur functional consultant to explore if the field can be made not mandatory..
    menu path:
    AR and AP -> Customer Accounts -> Line Items -> Display line items -> display line items without ALV

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

Maybe you are looking for

  • How do I re-format my iPod classic

    have an 80 gig classic and want to totally re-format it. any help? thanks, Mark

  • Is reset and restore the same?

    I need to reset my phone and I made an appointment at the Genius bar. This has happened before with my other iphone. My phone is saying that I don't have enough space in my icloud but I know that it does. It is saying that because my phone got corrup

  • New mac crashed

    long story short: bought my parents a new imac for christmas and spent the last month creating a family website for them on it. the other day it crashed. apple gave me a new one, and they were able to provide me with the web files (including the doma

  • Playing through car stereo

    I am having problems playing through car stereo using the cassette deck. Only getting audio out of right side. Have tried two Dyantec with same result. Ipod has sound on both sides through ear buds. Cassette deck is playing regular cassettes just fin

  • HTML classes in Portal

    Does anyone have a complete list of all HTML classes Portal pages use, or know where I can find such a list? A portal HTML class can for example be one like this: <FONT class = BannerSecondaryText> /Lene