Alarm of inefficient query Plans

SQL Server 5.6 cartridge DBSS - view Instance rule would give alarms for inefficient query Plans. Is it possible to get the same kind of alarms for Query Plans by using the SQL Server and SQL Performance Investigator 5.7 cartridge?

The 'Notice of Performance' function is currently being re-worked in SQL Performance researcher and is therefore not available in version 5.7.

The feature had become a bit bland in the analysis of the performance and I know that the development team has an exciting idea on how to return in a later version.  If you have something that you particularly liked, or an idea of how opinions can be improved, we will appreciate the feedback.

Tags: Dell Tech

Similar Questions

  • connection pool and inefficient query plan

    There is a single query that covers almost 90% of cpu DB.

    Select * from employee e, Department d where e.departement_id = d.department_id

    Us will gather statistics for this table in two, and the issues is resolved.

    This occurs every 2 weeks. That said, the query runs fine for 2 weeks and then we have questions... we will bring together the statistics of these two tables... and things are good for another 2 weeks.

    This query is a proc to store oracle pl - sql, which is called by the JDBC code. I introduced 2 months behind connection pooling, and today, we are facing this problem.

    The query has been accounting for 5 years with no problems.

    Before that I presented the connection pool, the jdbc code created a new connection before calling the store proc.

    Do you think that my connection to the connection pool has introduced this problem.

    The DBA tell me that the query runs a bad plan. Oracle recovers not the more effective plan (and that leads to this high CPU utilization).

    I guess that after 2 weeks Oracle begins to pick up plans that are effective in.

    Do you think all that this question never has nothing to do with my connection pooling code.

    I use Oracle 10 G.

    Hi Mike and ground beach thanks for your response.

    It was just a doubt... that you guys allowed.

    Thank you

    m

  • explain query plan uses no unique index with where condition

    Hi all

    I use in the 10.2.0.5 oracle database Enterprise edition 64-bit on 64-bit windows server 2008.

    I'm following this tutorial on my own table

    Guide to understanding Oracle QUERY PLAN - 10 minutes

    my questions are below

    Analyze table LIB_CLASSIFICATIONS compute statistics;
    explain plan for  SELECT class_id  FROM lib_classifications WHERE class_no = '538' ;
    select * from table(dbms_xplan.display);
    

    the result is less than

    Hash value of plan: 3022072076

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

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

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

    |   0 | SELECT STATEMENT |                     |     1.    10.     5 (0) | 00:00:01 |

    |*  1 |  TABLE ACCESS FULL | LIB_CLASSIFICATIONS |     1.    10.     5 (0) | 00:00:01 |

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

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

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

    1 - filter ("CLASS_NO" = '538')

    DESC LIB_CLASSIFICATIONS

    Name of Type Null

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

    CLASS_ID NOT NULL NUMBER (10)

    CLASS_DESC VARCHAR2 (50)

    REMARKS VARCHAR2 (250)

    CLASS_NO VARCHAR2 (20)

    CLASS_TYPE VARCHAR2 (10)

    CREATE_USER VARCHAR2 (10)

    MODIFY_USER VARCHAR2 (10)

    CREATE_DATE DATE

    MODIFY_DATE DATE

    CLASS_CATEGORY_ID VARCHAR2 (10)

    class_id has a primary key.

    now when I remove the condition where the query, the result is lower;

    Analyze table LIB_CLASSIFICATIONS compute statistics;
    explain plan for  SELECT class_id  FROM lib_classifications ;
    select * from table(dbms_xplan.display);
    

    the result is less than

    Hash value of plan: 262704430

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

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

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

    |   0 | SELECT STATEMENT |             |  1558.  6232.     2 (0) | 00:00:01 |

    |   1.  FULL RESTRICTED INDEX SCAN FAST | SYS_C005653 |  1558.  6232.     2 (0) | 00:00:01 |

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

    now it's using indexes with INDEX FAST FULL SCAN.

    I need the index using the WHERE condition as well.

    How to do this?

    Thank you.

    you have indexes on the column class_id not on class_no column how u would expect index to use when there is no index on the column class_no

  • Confused with SQL query plan numbers

    Hi all

    I'm on Oracle 11.2 "Standard Edition" under Windows.

    Here is a simple query plan and the predicate shown after the plan. I'm a little confused by the numbers indicated on the plan and not able to understand why the index is not used. The query is generated from Cognos front end, I captured using dbms_xplan.display_cursor (when the query was actually being run).

    SQL > select * from table (dbms_xplan.display_cursor ('& sqlid', 0));

    Enter the value of sqlid: 8yd0uu78jzqpg

    old 1: select * from table (dbms_xplan.display_cursor ('& sqlid', 0))

    new 1: select * from table (dbms_xplan.display_cursor('8yd0uu78jzqpg',0))

    PLAN_TABLE_OUTPUT

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

    SQL_ID, 8yd0uu78jzqpg, number of children 0

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

    Select distinct CASE WHEN (CASE WHEN ("MY_TRANSACTION_TABLE3". "NEW_OFFCR_CD" IS "

    NULL NULL) THEN ELSE ("MY_TRANSACTION_TABLE3". "NEW_OFFCR_CD" | " -") END IS NULL)"

    OR ("MY_TRANSACTION_TABLE3". ("' EMP_NM ' IS NULL) THEN NO OTHER (CASE

    WHEN ("MY_TRANSACTION_TABLE3". "NEW_OFFCR_CD" IS NULL), THEN ANOTHER NULL "

    ("MY_TRANSACTION_TABLE3". "NEW_OFFCR_CD" | " -")

    END | "" MY_TRANSACTION_TABLE3 ". ("" EMP_NM END ")"Officer_Name. "

    'MY_TRANSACTION_TABLE3 '. ' ' NEW_OFFCR_CD ' 'Officer_Code' of

    'FDS_LDN_APLOWNER '. ' ' MY_TRANSACTION_TABLE ' 'MY_TRANSACTION_TABLE3' where

    'MY_TRANSACTION_TABLE3 '. » M » (« A », « E », « U », « F ») et

    'MY_TRANSACTION_TABLE3 '. ' BASE_DT ' =: PQ1 and.

    'MY_TRANSACTION_TABLE3 '. "" NEW_OFFCR_CD "as 'LO %' order by

    'Officer_Code' asc nulls last

    Hash value of plan: 1213358407

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

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

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

    |   0 | SELECT STATEMENT |                       |       |       | 42146 (100) |          |

    |   1.  UNIQUE FATE |                       |   230.  5750 | 42145 (1) | 00:08:26 |

    |*  2 |   TABLE ACCESS FULL | MY_TRANSACTION_TABLE |  4283.   104K | 42144 (1) | 00:08:26 |

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

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

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

    2 filter (("MY_TRANSACTION_TABLE3". "NEW_OFFCR_CD" AS "% LO %' AND

    'MY_TRANSACTION_TABLE3 '. ' BASE_DT ' =: PQ1 AND.

    INTERNAL_FUNCTION ("MY_TRANSACTION_TABLE3". "M") AND "

    'MY_TRANSACTION_TABLE3 '. (("' NEW_OFFCR_CD ' IS NOT NULL))

    MY_TRANSACTION_TABLE has 1.3 million records. There is an index made up of 4 columns, first column is BASE_DT and none of the other columns is used here in the predicate.

    Questions-

    (1) the number the ROWS column in the plan, I guess it's number of selected records in the query (and not the records read by the query). Fix?

    (2) there is an index on this table from BASE_DT (but other 3 columns in the index are not used). Each base_dt will select approximately 1.3 M. 80000 records why the index is not used?

    (3) the column of time in the plan. Step 1 made by 08:26 minutes and not 2A crossed 08:26 minutes? or steps 1 and 2 together have 08:26 mins?

    Thanks in advance

    1 LINES - shows the no. of rows estimated by the optimizer for this operation. This estimate is made using the table and column statistics (+ a few formulas can be)

    2. with the help of the index is decided by the optimizer based on profit he would get him. Internally, the database comes up with a lot of plan and selects a plan and at low cost. She stated that in light of current statistics rather than index, scanning, beneficial full table scan - so index have not been used.

    3. it is worth cumulative - CBO estimated a total 08:26 minutes - similar to the cost. But this chronology may not be necessarily the actual execution time.

    Read this link: http://www.oracle.com/technetwork/database/bi-datawarehousing/twp-explain-the-explain-plan-052011-393674.pdf it has almost all the information about the execution plan.

  • Get statistics of query Plan

    Hello

    I sent a simple application on the server by default (on localhost) OEP in Eclipse. I can see the results in the console when the generator to send messages to the port 9200. Also, I can see that the application is RUNNING when I check the processing of the event viewer (http://localhost:9002 / wlevs /)

    However, on the page of query plan, the result of stat is always 0 for all operators... I take a look at all the documentation, but I could not solve the problem.

    See you soon,.

    Alireza

    For the review of the performance, query plan statistics news are disabled by default. To activate it, please add following in the server's config.xml file before starting the server.

    true

    Kind regards

    XiYing

  • What is the best query plan

    Hi all

    Please help me choose the query plan. You can tell me which is the best plan for the No. 1 query plan or no plan No 2
    Map 1:

    PLAN_TABLE_OUTPUT
    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Hash value of plan: 442504905

    -----------------------------------------------------------------------------------------------------
    | ID | Operation | Name | Lines | Bytes | Cost (% CPU). Time |
    -----------------------------------------------------------------------------------------------------
    | 0 | SELECT STATEMENT | 1. 325. 13222 (1) | 00:02:39 |
    | 1. SORT ORDER BY | 1. 325. 13222 (1) | 00:02:39 |
    | 2. UNIQUE HASH | 1. 325. 13221 (1) | 00:02:39 |
    | 3. NESTED LOOPS |
    | 4. NESTED LOOPS | 1. 325. 13220 (1) | 00:02:39 |
    | 5. NESTED LOOPS | 1. 224. 13217 (1) | 00:02:39 |

    PLAN_TABLE_OUTPUT
    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    | 6. NESTED LOOPS | 1. 199. 13216 (1) | 00:02:39 |
    | 7. NESTED LOOPS | 1. 144. 13215 (1) | 00:02:39 |
    |* 8 | HASH JOIN | 1. 93. 13212 (1) | 00:02:39 |
    |* 9 | TABLE ACCESS FULL | REC_EPS | 787. 25184 | 742 (2) | 00:00:09 |
    | * 10 | TABLE ACCESS FULL | RECEIPTDETAIL | 1059K | 61 M | 12462 (1) | 00:02:30 |
    | * 11 | TABLE ACCESS BY INDEX ROWID | LOTXLOCXID | 1. 51. 3 (0) | 00:00:01 |
    | * 12 | INDEX RANGE SCAN | IDX_LLI_ISQ | 1 | | 2 (0) | 00:00:01 |
    | 13. TABLE ACCESS BY INDEX ROWID | CODELKUP | 1. 55. 1 (0) | 00:00:01 |
    | * 14 | INDEX UNIQUE SCAN | PK_SYS_C004623 | 1 | | 0 (0) | 00:00:01 |
    | 15. TABLE ACCESS BY INDEX ROWID | RECEPTION | 1. 25. 1 (0) | 00:00:01 |
    | * 16. INDEX UNIQUE SCAN | PK_SYS_C004755 | 1 | | 0 (0) | 00:00:01 |

    PLAN_TABLE_OUTPUT
    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    | * 17. INDEX RANGE SCAN | PK_SYS_C004767 | 1 | | 2 (0) | 00:00:01 |
    | 18. TABLE ACCESS BY INDEX ROWID | SKU | 1. 101 | 3 (0) | 00:00:01 |
    -----------------------------------------------------------------------------------------------------

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

    8 - access("RECEIPTDETAIL".") RECEIPTKEY «= SYS_OP_C2C ("REC_EPS".» ASNKEY') AND
    'RECEIPTDETAIL '. "' SKU ' = SYS_OP_C2C ("REC_EPS". » « « « SKU »))
    9 filter (SYS_OP_C2C ("REC_EPS". "ASNKEY") > = U '0' AND "
    SYS_OP_C2C ("REC_EPS". ("ASNKEY") < = U'ZZZZZ ")

    PLAN_TABLE_OUTPUT
    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    10 - filter("RECEIPTDETAIL".") RECEIPTKEY' > = U "0" AND "RECEIPTDETAIL". "" RECEIPTKEY "< = U'ZZZZZ") "
    11 - filter("LOTXLOCXID".") LOC "= U 'STAGE')
    12 - access("RECEIPTDETAIL".") TOLD "=" LOTXLOCXID. " "" IDENTITY CARD "AND
    'RECEIPTDETAIL '. ' ' SKU '=' LOTXLOCXID. ' "' SKU ' AND 'LOTXLOCXID '. ("' QTY ' > 0)
    14 - access ("LISTNAME"= U 'RECSTATUS' AND "CODELKUP"." "RECEIPTDETAIL"="CODE". ("' STATUS ')
    16 - access("RECEIPTDETAIL".") RECEIPTKEY "=" RECEPTION ". ("' RECEIPTKEY")
    filter ("RECEPTION". "RECEIPTKEY" > = U '0' AND 'RÉCEPTION' "." " RECEIPTKEY"< = U'ZZZZZ") "
    17 - access("RECEIPTDETAIL".") SKU "=" SKU ". ("' SKU ')

    41 selected lines.
    =================================================================

    Plan No. 2:

    PLAN_TABLE_OUTPUT
    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Hash value of plan: 1174712643

    ----------------------------------------------------------------------------------------------------------
    | ID | Operation | Name | Lines | Bytes | Cost (% CPU). Time |
    ----------------------------------------------------------------------------------------------------------
    | 0 | SELECT STATEMENT | 1. 325. 18382 (1) | 00:03:41 |
    | 1. SORT ORDER BY | 1. 325. 18382 (1) | 00:03:41 |
    | 2. UNIQUE HASH | 1. 325. 18381 (1) | 00:03:41 |
    |* 3 | HASH JOIN | 1. 325. 18380 (1) | 00:03:41 |
    | 4. NESTED LOOPS |
    | 5. NESTED LOOPS | 1. 293. 17637 (1) | 00:03:32 |

    PLAN_TABLE_OUTPUT
    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    | 6. NESTED LOOPS | 1. 192. 17634 (1) | 00:03:32 |
    | 7. NESTED LOOPS | 1. 167. 17633 (1) | 00:03:32 |
    | 8. NESTED LOOPS | 2. 224. 17631 (1) | 00:03:32 |
    |* 9 | TABLE ACCESS BY INDEX ROWID | LOTXLOCXID | 2. 102. 3 (0) | 00:00:01 |
    | * 10 | INDEX RANGE SCAN | IDX_LOTXLOCXID_LOC | 2 | | 1 (0) | 00:00:01 |
    | * 11 | TABLE ACCESS BY INDEX ROWID | RECEIPTDETAIL | 1. 61. 8814 (1) | 00:01:46 |
    | * 12 | INDEX SCAN FULL | IDX_RD_QCREQ | 1 | | 8813 (1) | 00:01:46 |
    | 13. TABLE ACCESS BY INDEX ROWID | CODELKUP | 1. 55. 1 (0) | 00:00:01 |
    | * 14 | INDEX UNIQUE SCAN | PK_SYS_C004623 | 1 | | 0 (0) | 00:00:01 |
    | 15. TABLE ACCESS BY INDEX ROWID | RECEPTION | 1. 25. 1 (0) | 00:00:01 |
    | * 16. INDEX UNIQUE SCAN | PK_SYS_C004755 | 1 | | 0 (0) | 00:00:01 |

    PLAN_TABLE_OUTPUT
    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    | * 17. INDEX RANGE SCAN | PK_SYS_C004767 | 1 | | 2 (0) | 00:00:01 |
    | 18. TABLE ACCESS BY INDEX ROWID | SKU | 1. 101 | 3 (0) | 00:00:01 |
    | * 19. TABLE ACCESS FULL | REC_EPS | 787. 25184 | 742 (2) | 00:00:09 |
    ----------------------------------------------------------------------------------------------------------

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

    3 - access("RECEIPTDETAIL".") RECEIPTKEY «= SYS_OP_C2C ("REC_EPS".» ASNKEY') AND
    'RECEIPTDETAIL '. "' SKU ' = SYS_OP_C2C ("REC_EPS". » « « « SKU »))
    9 - filter("LOTXLOCXID".") QTY' > 0)

    PLAN_TABLE_OUTPUT
    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    10 - access("LOTXLOCXID".") LOC "= U 'STAGE')
    11 - filter("RECEIPTDETAIL".") RECEIPTKEY' > = U "0" AND "RECEIPTDETAIL". "" RECEIPTKEY "< = U'ZZZZZ") "
    12 - access("RECEIPTDETAIL".") SKU "=" LOTXLOCXID. " "' SKU ' AND
    'RECEIPTDETAIL '. "" TOLD "=" LOTXLOCXID. " (' ' ID ')
    filter ("RECEIPTDETAIL". "TOLD"="LOTXLOCXID" "." " IDENTITY CARD"AND
    'RECEIPTDETAIL '. ' ' SKU '=' LOTXLOCXID. ' ("' SKU ')
    14 - access ("LISTNAME"= U 'RECSTATUS' AND "CODELKUP"." "RECEIPTDETAIL"="CODE". ("' STATUS ')
    16 - access("RECEIPTDETAIL".") RECEIPTKEY "=" RECEPTION ". ("' RECEIPTKEY")
    filter ("RECEPTION". "RECEIPTKEY" > = U '0' AND 'RÉCEPTION' "." " RECEIPTKEY"< = U'ZZZZZ") "
    17 - access("RECEIPTDETAIL".") SKU "=" SKU ". ("' SKU ')
    19 - filter (SYS_OP_C2C ("REC_EPS". "ASNKEY") > = U '0' AND SYS_OP_C2C ("REC_EPS". " ASNKEY") < = U'ZZZZZ") "

    44 selected lines.

    Did you test them? You do not have us given information on why you want to use one over the other... For example, do you need to recover as soon as possible all lines or do you want the first rows as quickly as possible? Given that you did not formatting on your plans and we do not request or background, we can say nothing. Even for an experienced DBA/developer - it is not always possible to read a plan and determine which is the 'best' - test and then you can tell us.

  • Error getting query plans for queries involving logical operators

    I'm trying to gather information to improve the performance of queries for an application I am running using Oracle Berkeley XML database version 2.4.16 with all available patches installed and have encountered problems in the documentation of my XQuery query plans. I hope that these problems also partly explain query performance problems I'm having.

    Specifically, I use dbxml to start
    qplan collection('browser')/*[@parentIndex='none']

    <XQuery>
      <QueryPlanToAST>
        <LevelFilterQP>
          <StepQP axis="parent-of-attribute" uri="*" name="*" nodeType="element">
            <ValueQP container="browser" index="node-attribute-equality-string" operation="eq" child="parentIndex" value="none"/>
          </StepQP>
        </LevelFilterQP>
      </QueryPlanToAST>
    </XQuery>
    I have this make more complex as follows:
    qplan collection('browser')/*[@parentIndex='none' and @uri='http://example.com/']
    NB: the above should have been: collection qplan ("browser") / * open_square_bracket @parentIndex = "none" and @uri = "http://example.com/" close_square_bracket

    and the dbxml command-line utility responds with:
    queryPlan failed, Wrong number of arguments.
    This happens about any variation on this request where there are two conditions related (or gold) set term [].

    An overview of what motivates the error would be very useful.

    Thank you

    Geoff Shuetrim

    Published by: Geoff Shuetrim on February 6, 2009 14:26

    Hi Geoff,

    Please apply "" or "" to your expression of qplan. "
    Like this:

    qplan "collection('browser')/open_square_bracket[@a='b']"
    

    or

    qplan 'collection("browser")/open_square_bracket[@a="b"]'
    

    Note: as stated above, use ' ' inside the phrase while using "" outside of expression and use ' ' inside the phrase while using "'outside the expression.

    Published by: rucong.zhao on February 5, 2009 19:37

  • Query Plan changes when a static value is assigned to an update

    I have a table
    SQL> create table test
      2  as
      3  select '001' col
      4    from dual
      5  connect by level <= 15000
      6  /
    
    Table created.
    
    SQL> exec dbms_stats.gather_table_stats('SYSADM','TEST',CASCADE=>TRUE)
    
    PL/SQL procedure successfully completed.
    Now, I want to update the table so that each 5000 lines to be incremented as the value pass
    001.002... and so on.

    I did it.
    SQL> set autotrace traceonly explain
    SQL> set timing on
    SQL> update test t
      2     set col = (select to_char(trunc(rno/5000)+1,'fm009')
      3             from (select row_number() over(order by rowid) rno,
      4                               rowid
      5                     from test) t1
      6             where t.rowid = t1.rowid)
      7  /
    
    15000 rows updated.
    
    Elapsed: 00:03:49.06
    
    Execution Plan
    ----------------------------------------------------------
       0      UPDATE STATEMENT Optimizer=ALL_ROWS (Cost=8 Card=15000 Bytes=60000)
       1    0   UPDATE OF 'TEST'
       2    1     TABLE ACCESS (FULL) OF 'TEST' (TABLE) (Cost=8 Card=15000 Bytes=60000)
       3    1     VIEW (Cost=55 Card=15000 Bytes=375000)
       4    3       WINDOW (SORT) (Cost=55 Card=15000 Bytes=60000)
       5    4         TABLE ACCESS (FULL) OF 'TEST' (TABLE) (Cost=8 Card=15000 Bytes=60000)
    
    SQL> rollback
      2  /
    
    Rollback complete.
    
    Elapsed: 00:00:01.00
    It works very well. But what I discovered is. When I change the update above. And replace the
    TO_CHAR (trunc(RNO/5000) + 1, 'fm009') with a static value as '1' the query plan changes and
    It runs very quickly.
    SQL> update test t
      2     set col = (select '1'--to_char(trunc(rno/5000)+1,'fm009')
      3             from (select row_number() over(order by rowid) rno,
      4                               rowid
      5                     from test) t1
      6             where t.rowid = t1.rowid)
      7  /
    
    15000 rows updated.
    
    Elapsed: 00:00:00.01
    
    
    Execution Plan
    ----------------------------------------------------------
       0      UPDATE STATEMENT Optimizer=ALL_ROWS (Cost=8 Card=15000 Bytes =60000)
       1    0   UPDATE OF 'TEST'
       2    1     TABLE ACCESS (FULL) OF 'TEST' (TABLE) (Cost=8 Card=15000 Bytes=60000)
       3    1     TABLE ACCESS (BY USER ROWID) OF 'TEST' (TABLE) (Cost=1 Card=1 Bytes=4)
    
    SQL> rollback
      2  /
    
    Rollback complete.
    
    Elapsed: 00:00:01.00
    Why is it so. Can someone explain?

    Karthick_Arp wrote:
    SQL > update of test t
    2 set col = (select to_char (trunc(rno/5000) + 1, 'fm009'))
    3 from (select row_number() over (order by rowid) rno,
    4 rowid
    5 test) t1
    6 where t.rowid = t1.rowid)
    7.

    15000 lines to date.

    Execution plan
    ----------------------------------------------------------
    STATEMENT UPDATE 0 = ALL_ROWS optimizer (cost = card 8 = 15000 bytes = 60000)
    1 0 UPDATE OF 'TEST '.
    2 1 TABLE ACCESS (FULL) 'TEST' (TABLE) (cost = card 8 = 15000 bytes = 60000)
    3 1 VIEW (cost = map 55 = 15000 bytes = 375000)
    4 WINDOW 3 (TRI) (cost = map 55 = 15000 bytes = 60000)
    5 4 TABLE ACCESS (FULL) 'TEST' (TABLE) (cost = card 8 = 15000 bytes = 60000)

    SQL > update of test t
    2 set col = (select '1' - to_char (trunc(rno/5000) + 1, 'fm009'))
    3 from (select row_number() over (order by rowid) rno,
    4 rowid
    5 test) t1
    6 where t.rowid = t1.rowid)
    7.

    15000 lines to date.

    Execution plan
    ----------------------------------------------------------
    STATEMENT UPDATE 0 = ALL_ROWS optimizer (cost = card 8 = 15000 bytes = 60000)
    1 0 UPDATE OF 'TEST '.
    2 1 TABLE ACCESS (FULL) 'TEST' (TABLE) (cost = card 8 = 15000 bytes = 60000)
    3 1 ACCESS TABLE (BY USER ROWID) OF 'TEST' (TABLE) (cost = 1 card = 1 bytes = 4)

    Why is it so. Can someone explain?

    In addition to what Rob has already said, the answer to your question is: given that the optimizer is smart and recognizes that your WINDOW TYPE in your second query (aka NWR) is never accessible and therefore simply ignores this part of the application. It turns it to a simple statement like this:

    update test t
       set col = (select '1'
               from (select rowid
                       from test) t1
               where t.rowid = t1.rowid);
    

    who can simply access the TEST table for each row of rowid, while your first query should do recursively for each TEST line full table scan. Using a statistics AUTOTRACE, you should see a large difference in e/s logic for both statements.

    Using DBMS_XPLAN. DISPLAY could reveal more details what happens, if you're already on 9i or later version (seems to be 9iR2).

    Kind regards
    Randolf

    Oracle related blog stuff:
    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/

  • Java: Making query plans persistent

    Sorry if this is a repost from the other thread, but that is the ultimate question.

    I have around 200-300 unique queries (this is a worst case scenario, but against what I run upward at the moment) that must be performed on the DBXML. The queries themselves last about 300-400 ms. If I first prepare these queries and then use the returned XmlQueryExpression, queries return 0ms and less then average. It seems that the majority of treatment is actually being with the back-end query optimization and forming part of the execution. Unfortunately, the record of the 200-300 XmlQueryExpression in memory is not a valid option because this increases memory usage a lot. The problem is that there are inherent with the underlying DBXML instability and sometimes the database switches and must be restarted, which means that the XmlQueryExpression must be replaced later...

    An example would be for a unique look, several objects should be returned from the database - each of these objects, if they took 300-400ms would add 3-4 seconds per unique rendering and if this situation worsened with a single rendered rendered several renders, then return to 15-16 seconds is likely. These compounds as more and more users access the system and must therefore be reduced as much as humanly possible.

    The question is multi fold:
    (1) is there a way so that the XmlQueryExpressions can be serialized and reused later-(l'idée serait de stocker éventuellement dans une cache de type structure/filesystem/base de données/etc...)?
    (2) is it possible to create a XmlQueryExpression with an existing query Plan for failing to make the entire expression on each go-around (same number 1 but to approach different idea)?
    (3) (another issue) being the transactional database - what I need to do something with the explicit transactions and undertakes on these objects of XmlQueryExpression despite the requests themselves are only, read-only? In other words I have to commit after. prepare(), but not on. execute()? Everything works fine without the use of transactions on the ready then I guess not.
    (4) is there another way I can optimize it? With hundreds of access/renders/objects read at some point, the system latency must be reduced as much as possible - by creating the XmlQueryExpression I compensate for the latency for the first time that the query is running, however over time that there is this pretty red and green baloon memory and I need a way of popping it.

    Hello Stephen,

    What version of XML DB are you using? If you use XML DB 2.4.13, there will soon be a new version of patch that significantly reduced the memory used by the previously analyzed queries.

    It is rare to find someone who needs to execute queries different as - is possible that you could be better off by combining some of the queries?

    (1) is there a way so that the XmlQueryExpressions can be serialized and reused later-(l'idée serait de stocker éventuellement dans une cache de type structure/filesystem/base de données/etc...)?
    (2) is it possible to create a XmlQueryExpression with an existing query Plan for failing to make the entire expression on each go-around (same number 1 but to approach different idea)?

    There is no way to do at the moment.

    (3) (another issue) being the transactional database - what I need to do something with the explicit transactions and undertakes on these objects of XmlQueryExpression despite the requests themselves are only, read-only? In other words I have to commit after. prepare(), but not on. execute()? Everything works fine without the use of transactions on the ready then I guess not.

    Prepares a query should probably be in an explicit transaction for transactional applications, but this transaction can safely be validated after the preparation of the query without for as much invalidating the XmlQueryExpression object.

    (4) is there another way I can optimize it? With hundreds of access/renders/objects read at some point, the system latency must be reduced as much as possible - by creating the XmlQueryExpression I compensate for the latency for the first time that the query is running, however over time that there is this pretty red and green baloon memory and I need a way of popping it.

    Why not maintain that sort less recently used (LRU) cache prepared queries? My guess is that you will have a small number of queries that get used a lot, and others who do not get used much at all.

    John

  • To the topic to explain the query Plan

    Hello

    I have a question about the explain plan command. While gather us statistics and optimize, then choose the best possible plan out the plans explain command available. If we collect statistics on a table for a long time while the system choose:

    Whether it will continue to use the same plan, since it uses at startup when statistics have been collected, or will change the plan as soon as dml activities and statistics grow old.

    Thank you
    GK

    Gulshan says:
    Hello

    I have a question about the explain plan command. While gather us statistics and optimize, then choose the best possible plan out the plans explain command available. If we collect statistics on a table for a long time while the system choose:

    The same plan he chose to start with previous statistics. The plan will not change automatically as long as you update the statistics.

    Whether it will continue to use the same plan, since it uses at startup when statistics have been collected, or will change the plan as soon as dml activities and statistics grow old.

    The DML will not be able to change the statistics stored in the data dictionary views themselves. There must be a statistic explicit collection that has come to reflect the change in the data dictionary. 10 g from, there is automatically a task (a special 11 g automatic) is there who can detect the change in the ongoing dml on the table and can trigger the table for update statistics.

    Aman...

  • Sense of understanding to explain the plan of a query

    Hello

    I have a simple question, but its query plan is looking hard for me to understand. Can someone explain to me step by step what is happening in the query. I mean "first step emp table is complete analysis, the next step is analysis from another table... "etc - in this way. I can't distinguish and need help to understand.
    SQL> explain plan for
      2  SELECT ename,dname ,grade 
      3  from n1.salgrade salgrade ,n1.emp emp,n1.dept dept
      4  where emp.deptno=dept.deptno and
      5  emp.sal between salgrade.losal and salgrade.hisal;
    SQL> select plan_table_output from table(dbms_xplan.display());
    Plan hash value: 4131418678
    
    ----------------------------------------------------------------------------------
    | Id  | Operation             | Name     | Rows  | Bytes | Cost (%CPU)| Time     |
    ----------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT      |          |     1 |    36 |    12  (25)| 00:00:01 |
    |*  1 |  HASH JOIN            |          |     1 |    36 |    12  (25)| 00:00:01 |
    |   2 |   MERGE JOIN          |          |     1 |    23 |     8  (25)| 00:00:01 |
    |   3 |    SORT JOIN          |          |     5 |    50 |     4  (25)| 00:00:01 |
    |   4 |     TABLE ACCESS FULL | SALGRADE |     5 |    50 |     3   (0)| 00:00:01 |
    |*  5 |    FILTER             |          |       |       |            |          |
    |*  6 |     SORT JOIN         |          |    14 |   182 |     4  (25)| 00:00:01 |
    |   7 |      TABLE ACCESS FULL| EMP      |    14 |   182 |     3   (0)| 00:00:01 |
    |   8 |   TABLE ACCESS FULL   | DEPT     |     4 |    52 |     3   (0)| 00:00:01 |
    ----------------------------------------------------------------------------------
    
    Predicate Information (identified by operation id):
    ---------------------------------------------------
    
       1 - access("EMP"."DEPTNO"="DEPT"."DEPTNO")
       5 - filter("EMP"."SAL"<="SALGRADE"."HISAL")
       6 - access("EMP"."SAL">="SALGRADE"."LOSAL")
           filter("EMP"."SAL">="SALGRADE"."LOSAL")
    for example, my question is why there are SUCH JOINT market no 6? This means that the lines obtained in step 7 are sorted? than what is being done in the step of the FILTER? Why are there so many joins. Basically, I'm not good in this area therefore need assistance.

    Thank you

    Published by: orausern on September 23, 2010 11:58

    Yes, KIND of JOIN is the stage of sorting of the merge join; in other words, to perform a merge join, there are two sorted input stream.

    Iggy

  • Explain the plan of a query?

    Hello
    How I watched the explain query plan?

    I tried...
     
       explain plan for select * from dual; 
       
       Explained 
       
      
    then then I tried
     
        select * from  from table(dbms_xplan.display); 
    
       plan_table_output 
       .... 
    
       
    Oracle version 11.1.0 information;

    Is what I have, it is true m do? or if not can you explain to me how I am looking for explain plan of the query...

    Thank you!!!

    Yes, that seems correct

    SQL> explain plan for
      2  select *
      3    from dual
      4  /
    
    Explained.
    
    SQL> select *
      2    from table (dbms_xplan.display())
      3  /
    
    PLAN_TABLE_OUTPUT
    ----------------------------------------------------------------------------------
    Plan hash value: 272002086
    
    --------------------------------------------------------------------------
    | Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    --------------------------------------------------------------------------
    |   0 | SELECT STATEMENT  |      |     1 |     2 |     2   (0)| 00:00:01 |
    |   1 |  TABLE ACCESS FULL| DUAL |     1 |     2 |     2   (0)| 00:00:01 |
    --------------------------------------------------------------------------
    
    8 rows selected.
    
    SQL> 
    
  • CLIQ - alarm: no sound only vibrates

    The alarm goes off as planned, but the phone does not produce a noise, only vibrates. I chose different types of ringtones, but none works. I put the volume of the alarm at its high level even then the only vibrartes phone.

    go to menu > clock > select the alarm that you want to change the volume on > highlight all the way down and select the volume. Uncheck the box titled 'increase' - let me know if that helps

  • Alarming - alarms defined by the user not appearing is not in history

    Hello

    I use the DSC module to create alarms.  I can successfully configure an alarm for a shared variable.  I use the alarms.vi of reading to read the current alarms.   I am able to recognize and to disappear which removes them from the list.  I also see a history of them when using the "alarm and event Query.vi.  Now, I do the same with user-defined alarms.  I have created alarm using the "user defined Alarm.vi value.  The alarm are displayed in the list (read alarms.vi).  I can acknowledge the alarm and it disappears from the list.  Now when I use the 'alarm & Query.vi' the user defined alarm does not appear in the list.  Only shared variable alarms are displayed.  Is this correct?  Is there a good example of what I'm doing?  The example of "User defined DSC alarms Demo.vi" does not give an example of reading historical alarms defined by the user of the database.

    Thank you

    Matt

    I removed the DSC module and re-installed which includes SQL Server.  That did the trick.

    Thanks for your help Caleb

  • DROID: How to turn an alarm... and in a simple way?

    This morning my alarm went off as planned, but no Snooze button or do disappear appeared, as they had an alarm earlier.  I tried just about everything I could think off this alarm... I tried to change the alarm time, change the sound of "silent"... I really just wanted the alarm stopped, but did not want to turn off the phone.  Finally, after playing with her, to no avail, I left the alarm go off for 10 minutes.  What did I miss?

    ESMIA: In the clock application, go to the Menu: settings: button behavior side.  You can then choose to 'None', 'Snooze' or 'dismiss '.

Maybe you are looking for

  • The screen sharing / video conference

    Hey guys,. I'm trying to understand the best way to share my screen with a number of customers all over the world. I recently saw that iMessage, now called Messages, can make screen sharing. So I try to know if everyone can use Messages in order to s

  • Satellite L50DT-a - buttons Mute / Volume not working properly

    My L50Dt-a satellite suddenly had the Mute button change its function. When I'm Microsoft Windows it full screens page I'm on rather than turn the sound we or off. I've updated question 8.1 window and it worked very well. The only change I have made

  • T420 start (power on) at all

    Hello My T420 light up at all. I tried to turn it on with the cable without cable, different baterries, removed the Rams and tried the same things, tried holding down the power button for 60 seconds, tried with another keyboard and I could not able t

  • Generation of SPI by using the b PCIe-6535

    Hello I have a data ready signal generated every 100uS or so by a SPINNAKER of slaves. The SPI master must generate then 96 SPI clocks anhd captures data returned. The process is repeated every 100uS. The SPI 96 clocks must be completed before the ne

  • How to generate a matrix of data in column 3

    I am eager to generate a matrix using data attached so that x is row 1 and column 1. I tried to divide the table and using the generation of table however it did not work. I checked the forums but no luck. any idea would be appreciated