Cost of execution of a query

Hi,
I have two queries both give exactly the same result set , both the queries are identical just with one difference , in one query we have code = '51 2345' and in the other query we have text = 'impulse' , which is the text value for the code .
The query with text in the condition gives cost = 1450
and the query with code in the condition gives cost = 332 .
But the query with cost = 1450 takes 4 mins to execute
and the query with cost = 332 takes 40 mins to execute .
Is it possible that cost of execution as shown by running the explain plan for that query is more and still its fast .so if yes then how to determine why is one query fast and the other query slow.
Thanks.

Hi,
I have two queries both give exactly the same result set , both the queries are identical just with one difference , in one query we have code = '51 2345' and in the other query we have text = 'impulse' , which is the text value for the code .
The query with text in the condition gives cost = 1450
and the query with code in the condition gives cost = 332 .
But the query with cost = 1450 takes 4 mins to execute
and the query with cost = 332 takes 40 mins to execute .
Is it possible that cost of execution as shown by running the explain plan for that query is more and still its fast .so if yes then how to determine why is one query fast and the other query slow.
Thanks.

Similar Messages

  • How query cost and execution time are releated ?

    hi experts,
      i am curious to know, how the query cost and execution time is related?
     Query taking less time ,query cost is 65%, but query taking more time but query cost is 0%.
    how to connect both and improve query performance.
    Thanks

    i think you are refering to cost (relative to the batch) execution 65%, where there are more that one statement, it may compare the cost of each statement with in the batch
    i assume it mainly take subtree cost and IO stat as cost, but in some cases i may wrong when there is multi line function and many other facter influence the cost, and i would say it depends on the query
    cost is unit-less
    The reason these costs exist is because of the query optimization SQL Server does: it does cost-based optimization, which means that the optimizer formulates a lot of different ways to execute the query, assigns a cost to each of these alternatives, and
    chooses the one with the least cost. The cost tagged on each alternative is heurestically calculated, and is supposed to roughly reflect the amount of processing and I/O this alternative is going to take.
    refer :
    http://blogs.msdn.com/b/sqlqueryprocessing/archive/2006/10/11/what-is-this-cost.aspx
    Thanks
    Saravana kumar C

  • How can I get the elapse time for execution of a Query for a session

    Hi ,
    How can I get the elapse time for execution of a Query for a session?
    Example - I have a report based on the procedure ,when the user execute that it takes say 3 min. to return rows.
    Is there any possible way to capture this session info. for this particular execution of query along with it's execution elapse time?
    Thanks in advance.

    Hi
    You can use the dbms_utility.get_time tool (gives binary_integer type value).
    1/ Initialize you time and date of beginning :
    v_beginTime := dbms_utility.get_time ;
    2/ Run you procedure...
    3/ Get end-time with :
    v_endTime := dbms_utility.get_time ;
    4/ Thus, calculate elapsed time by difference :
    v_elapsTime := v_endTime - v_beginTime ;
    This will give you time elapsed in of 100th of seconds...
    Then you can format you result to give correct print time.
    Hope it will help you.
    AL

  • Getting an error when i am execution a BI query using ABAP.

    Hi Expert,
    I am getting an error when i am execution a BI query using ABAP. Its Giving me this Error "The Info Provider properties for GHRGPDM12 are not the same as the system default" and in the error analysis it saying as bellow.
    Property Data Integrity has been set differently to the system default.
    Current setting: 0 for GHRGPDM12
    System default: u2019 7 u2018
    As I am very new to BI and have very limited knowledge, so I am not able to understand this problem. Can any one help me to resolving this issue. Previously it as working fine, I am getting this error last 2 days.
    when i am debugging , I am getting error from
    create instance of cl_rsr_request
    CREATE OBJECT r_request
    EXPORTING
    i_genuniid = p_genuniid.
    this FM. Its not able to create the object. Can any one please help me out.
    Thanks in advance.
    Regards
    Satrajit

    Hi,
    I am able to solve this problem
    Regards
    Satrajit

  • Can we suppress execution of a query so as to optionally execute queries in data modl

    Can we suppress execution of a query so that we optionally execute queries?0
    I have a combo box in Parameter Form. It has 3 options. I have 3 queries in Data Model.
    I want to execute only one of these 3 queries based on user's selection from combo box.
    I want that other 2 queries do NOT execute at all for that processing cycle. Next time user selects other option and an other query is executed and other 2 are NOT executed and so on.
    Is it possible in Reports 6i in Client/server?
    Pl. guide.
    Tariq

    Include:
    AND :parameter = <this query's value> (e.g. 1 or "SALES" or whatever)
    in each query's where clause. Because this is 2 constants (as far as the SQL interpreter is concerned) it will evaluate it first. If the parameter is set to a value not for this query then it will return no rows with minimal overhead.

  • Getting an error when i am execution an BI query

    Hi Expert,
    I am getting an error when i am execution an BI query using ABAP. Its Giving me this Error  "The Info Provider properties for GHRGPDM12 are not the same as the system default" and in the error analysis it saying  as bellow.
    Property Data Integrity has been set differently to the system default.
    Current setting: 0 for GHRGPDM12
    System default: u2019 7  u2018
    As I am very new to BI and have very limited knowledge, so I am not able to understand this problem. Can any one help me to resolving this issue. Previously it as working fine, I am getting this error last 2 days.
    when i am debugging , I am getting error from
    create instance of cl_rsr_request
      CREATE OBJECT r_request
        EXPORTING
          i_genuniid = p_genuniid.
    this FM. Its not able to create the object. Can any one please help me out.
    Regards
    Satrajit

    Hi,
    I am able to solve this problem
    Regards
    Satrajit

  • Multiple executions of a query found in the ADDM Report

    Hi,
    I generated an ADDM Report on my DB for the time when the DB performance was very slow. Below are some lines from it:
    RECOMMENDATION 1: SQL Tuning, 15% benefit (28820 seconds)
    ACTION: Run SQL Tuning Advisor on the SQL statement with SQL_ID
    "725bgkkhqs73v".
    RELEVANT OBJECT: SQL statement with SQL_ID 725bgkkhqs73v and
    PLAN_HASH 2688602638
    select column1,column2 from table1;
    ACTION: Investigate the SQL statement with SQL_ID "725bgkkhqs73v" for
    possible performance improvements.
    RELEVANT OBJECT: SQL statement with SQL_ID 725bgkkhqs73v and
    PLAN_HASH 2688602638
    select column1, column2 from table1;
    RATIONALE: SQL statement with SQL_ID "725bgkkhqs73v" was executed 32 times and had an average elapsed time of 900 seconds.
    Can anyone help me out with the reason behind these repeated executions of the SQL query thus resulting in a avg elapsed time of 15 mins. Also, I could see that some queries ran on the DB even for 145,445,335 times, however the total time elapsed for executing these queries was only 0.000048 seconds.
    COuld it be because there was exclusive locks on those tables during the times there queries were getting executed or do I need to look at query tuning here? Kindly help.

    yeah. posting it here:
    select column1,column2 from table1;
    Plan hash value: 2688602638
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | | | 4 (100)| |
    | 1 | HASH GROUP BY | | 1 | 77 | 4 (25)| 00:00:01 |
    | 2 | TABLE ACCESS BY INDEX ROWID| column1 | 1 | 18 | 1 (0)| 00:00:01 |
    | 3 | NESTED LOOPS | | 1 | 77 | 3 (0)| 00:00:01 |
    | 4 | TABLE ACCESS FULL | column2 | 1 | 59 | 2 (0)| 00:00:01 |
    | 5 | INDEX RANGE SCAN | x_abc | 1605 | | 1 (0)| 00:00:01 |
    SQL_ID 725bgkkhqs73v
    select column1, column2 from table1;
    Plan hash value: 2947532035
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | | | 4 (100)| |
    | 1 | HASH GROUP BY | | 41 | 1476 | 4 (50)| 00:00:01 |
    | 2 | TABLE ACCESS BY INDEX ROWID | column1 | 14 | 252 | 1 (0)| 00:00:01 |
    | 3 | NESTED LOOPS | | 50 | 1800 | 2 (0)| 00:00:01 |
    | 4 | TABLE ACCESS BY INDEX ROWID| column1 | 3 | 54 | 1 (0)| 00:00:01 |
    | 5 | INDEX RANGE SCAN | X_abc| 1602 | | 1 (0)| 00:00:01 |
    | 6 | INDEX RANGE SCAN | XAK_def| 14 | | 1 (0)| 00:00:01 |
    Does this shed any light?
    Thanks in advance for all your help!

  • Execution time of query on different indexes

    Hello,
    I have a query on the table, the execution time has hugh difference using different indexes on the table. The table has about 200,000 rows. Any explaination on it?
    Thanks,
    create table TB_test
    ( A1 number(9),
    A2 number(9)
    select count(*) from TB_test
    where A1=123 and A2=456;
    A. With index IDX_test on column A1:
    Create index IDX_test on TB_test(A1);
    Explain plan:
    SELECT STATEMENT
    Cost: 3,100
    SORT AGGREGATE
    Bytes: 38 Cardinality: 1
    TABLE ACCESS BY INDEX ROWID TABLE TB_test
    Cost: 3,100 Bytes: 36 Cardinality: 1
    INDEX RANGE SCAN INDEX IDX_test
    Cost: 40 Cardinality: 21,271
    Execution time is : 5 Minutes
    B. With index IDX_test on column A1 and A2:
    Create index IDX_test on TB_test(A1, A2);
    Explain plan:
    SELECT STATMENT
    Cost: 3 Bytes: 37 Cardinality: 1
    SORT AGGREGATE
    Bytes: 37 Cardinality: 1
    INDEX RANGE SCAN INDEZ IDX_test
    Cost: 3 Bytes 37 Cardinality:1
    Execution time is: 1.5 Seconds

    Additional you should check how many values you have in your table for the specific column values.
    The following select might be helful for that.
    select count(*)  "total_count"
           ,count(case when A1=123 then 1 end) "A1_count"
           ,count(case when A1=123 and A2=456 then 1 end) "A1andA2_count"
    from TB_test;Share your output of this.
    I expect the value for A1_count still to be high. But the value for A1+A2_count relatively low.
    However 5 minutes is far to long for such a small table. Even if you run it on a laptop.
    There must be a reason why it is that slow.
    First thing to consider would be to update your statistics for the table and the index.
    Second thing could be that the table is very sparsly fillled. Meaning, if you frequently delete records from this table and load new data using APPEND hint, then the table will grow, because the free space from the deletes is never reused. Any table access in the execution plan, will be slower then needed.
    A similar thing can happen, if many updates on previously empty columns are made on a table (row chaining problem).
    So if you explain a little, how this table is filled and used, we could recognize a typical pattern that leads to performance issues.
    Edited by: Sven W. on Nov 28, 2012 5:54 PM

  • Cost vs Execution Time

    Query Without Index Hint
    Cost is 11 and the execution time of the Query is 5 secs
    Query With Index Hint
    Cost is 3453 and the execution time for the query is 560 msecs.
    Can anyone tell me which one I should be using the one with minimal cost or with minimal execution time?
    Thanks

    > Without Hint
    The query uses Index I2 Excecution time 5 secs
    With Hint
    560msecs
    And that explains the so-called CBO cost anomaly between the two.
    When you add a hint to a query, you're forcing the CBO to change the "expense" of I/O paths and rate, for example, the forced (hinted) index as a cheaper path than the default index - as the CBO needs to "push" that hinted index up the chain as a cheaper path.
    Costs are internally adjusted due to that hint in order to satisfy that hint (or at least try to). The resulting cost determined by the CBO is for all intends and purposes a random number when used as a comparison with the costs of same query without a hint or with a different hint.

  • Execution plan of query

    Hi all,
    There is a statement:
    For example for qid=-4 takes 3 min 20 sec.
    SELECT id, org, count(aa) cnt
    FROM (SELECT DISTINCT id, org, aa
          FROM zzz_temp_nn, molfrelflat, (SELECT DISTINCT m.prot aa, nvl
    (org, 0) org, molf tid FROM molfprot m, (SELECT DISTINCT prot, org FROM
    protorgs WHERE trust >= 0 AND decode(org, 0, 0, 1) = 1) o WHERE m.prot
    = o.prot(+))
          WHERE qid = -4 AND id = molfgrp AND molfmbr = tid)
    GROUP BY id, org
    no rows selected
    Elapsed: 00:03:20.41
    Execution plan:
    | Id  | Operation                                | Name                         | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT                         |                              |     1 |    39 |    29   (7)| 00:00:01 |
    |   1 |  HASH GROUP BY                           |                              |     1 |    39 |    29   (7)| 00:00:01 |
    |   2 |   VIEW                                   |                              |     1 |    39 |    28   (4)| 00:00:01 |
    |   3 |    HASH UNIQUE                           |                              |     1 |   133 |    28   (4)| 00:00:01 |
    |   4 |     NESTED LOOPS                         |                              |     1 |   133 |    27   (0)| 00:00:01 |
    |   5 |      NESTED LOOPS                        |                              |     1 |   128 |    26   (0)| 00:00:01 |
    |   6 |       NESTED LOOPS                       |                              |     1 |   123 |    25   (0)| 00:00:01 |
    |   7 |        NESTED LOOPS                      |                              |     1 |   118 |    24   (0)| 00:00:01 |
    |   8 |         NESTED LOOPS                     |                              |     1 |   113 |    23   (0)| 00:00:01 |
    |   9 |          NESTED LOOPS                    |                              |     1 |   102 |    21   (0)| 00:00:01 |
    |  10 |           NESTED LOOPS                   |                              |     1 |    91 |    19   (0)| 00:00:01 |
    |  11 |            NESTED LOOPS                  |                              |     1 |    80 |    17   (0)| 00:00:01 |
    |  12 |             NESTED LOOPS OUTER           |                              |     1 |    69 |    15   (0)| 00:00:01 |
    |  13 |              NESTED LOOPS                |                              |     1 |    54 |    12   (0)| 00:00:01 |
    |  14 |               NESTED LOOPS               |                              |     1 |    38 |     4   (0)| 00:00:01 |
    |* 15 |                TABLE ACCESS FULL         | ZZZ_TEMP_NN                  |     1 |    26 |     2   (0)| 00:00:01 |
    |* 16 |                INDEX RANGE SCAN          | UNITRELFLAT_UI_UNITG_UNITM   |     3 |   114 |     2   (0)| 00:00:01 |
    |* 17 |               TABLE ACCESS BY INDEX ROWID| UNITRELS                     |     1 |    16 |     8   (0)| 00:00:01 |
    |* 18 |                INDEX RANGE SCAN          | UNITRELS_I_UNITG             |    15 |       |     2   (0)| 00:00:01 |
    |* 19 |              TABLE ACCESS BY INDEX ROWID | PROTORGS                     |     1 |    15 |     3   (0)| 00:00:01 |
    |* 20 |               INDEX RANGE SCAN           | PROTORGS_UI_PROT_ORG_TIS_LOC |     1 |       |     2   (0)| 00:00:01 |
    |* 21 |             INDEX RANGE SCAN             | UNITS_UI_ID_TYPE             |     1 |    11 |     2   (0)| 00:00:01 |
    |* 22 |            INDEX RANGE SCAN              | UNITS_UI_ID_TYPE             |     1 |    11 |     2   (0)| 00:00:01 |
    |* 23 |           INDEX RANGE SCAN               | UNITS_UI_ID_TYPE             |     1 |    11 |     2   (0)| 00:00:01 |
    |* 24 |          INDEX RANGE SCAN                | UNITS_UI_ID_TYPE             |     1 |    11 |     2   (0)| 00:00:01 |
    |* 25 |         TABLE ACCESS BY INDEX ROWID      | KND_UNITS                    |     1 |     5 |     1   (0)| 00:00:01 |
    |* 26 |          INDEX UNIQUE SCAN               | KND_UNITS_PK                 |     1 |       |     0   (0)| 00:00:01 |
    |* 27 |        TABLE ACCESS BY INDEX ROWID       | KND_UNITS                    |     1 |     5 |     1   (0)| 00:00:01 |
    |* 28 |         INDEX UNIQUE SCAN                | KND_UNITS_PK                 |     1 |       |     0   (0)| 00:00:01 |
    |* 29 |       TABLE ACCESS BY INDEX ROWID        | KND_UNITS                    |     1 |     5 |     1   (0)| 00:00:01 |
    |* 30 |        INDEX UNIQUE SCAN                 | KND_UNITS_PK                 |     1 |       |     0   (0)| 00:00:01 |
    |* 31 |      TABLE ACCESS BY INDEX ROWID         | KND_UNITS                    |     1 |     5 |     1   (0)| 00:00:01 |
    |* 32 |       INDEX UNIQUE SCAN                  | KND_UNITS_PK                 |     1 |       |     0   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
      15 - filter("QID"=(-4))
      16 - access("ID"="R"."UNITG")
      17 - filter("R"."TYPE"=0)
      18 - access("R"."UNITM"="R"."UNITG")
      19 - filter("TRUST"(+)>=0)
      20 - access("R"."UNITM"="PROT"(+))
           filter(DECODE("ORG"(+),0,0,1)=1)
      21 - access("R"."UNITG"="UG"."ID")
      22 - access("R"."UNITM"="UM"."ID")
      23 - access("R"."UNITM"="UM"."ID")
      24 - access("R"."UNITG"="UG"."ID")
      25 - filter("KG"."TREE"=1)
      26 - access("UG"."TYPE"="KG"."ID")
      27 - filter("KM"."TREE"=0)
      28 - access("UM"."TYPE"="KM"."ID")
      29 - filter("KG"."TREE"=1)
      30 - access("UG"."TYPE"="KG"."ID")
      31 - filter("KM"."TREE"=1)
      32 - access("UM"."TYPE"="KM"."ID")
    molfrelflat, molfprot - are views.
    Molfrelflat:
    SELECT r.unitg as molfgrp, r.unitm as molfmbr, r.dist, r.spl
    FROM unitrelflat r, units ug, knd_units kg, units um, knd_units km
    WHERE r.unitg = ug.id and ug.type = kg.id and kg.tree = 1 and
          r.unitm = um.id and um.type = km.id and km.tree = 1
    Molfprot:
      SELECT r.unitg as molf, r.unitm as prot
    FROM unitrels r, units ug, knd_units kg, units um, knd_units km
    WHERE r.type = 0 and
      r.unitg = ug.id and ug.type = kg.id and kg.tree = 1 and
      r.unitm = um.id and um.type = km.id and km.tree = 0
    SELECT table_name,num_rows,last_analyzed
    FROM user_tables
    WHERE table_name in ('UNITRELS','UNITRELFLAT','KND_UNITS','UNITS');Which way to disassemble a query? Thanks in advance.
    Best regards, Pavel.

    Why E-Rows not equal to A-Rows after gather stats on index?
    SQL> exec dbms_stats.gather_index_stats(user,'UNITRELFLAT_UI_UNITG_UNITM');
    PL/SQL procedure successfully completed.
    SQL> exec dbms_stats.gather_index_stats(user,'UNITRELS_I_UNITG');
    PL/SQL procedure successfully completed.
    SQL> exec dbms_stats.gather_index_stats(user,'PROTORGS_UI_PROT_ORG_TIS_LOC');
    PL/SQL procedure successfully completed.
    SQL> exec dbms_stats.gather_index_stats(user,'UNITS_UI_ID_TYPE');
    PL/SQL procedure successfully completed.
    SQL> exec dbms_stats.gather_index_stats(user,'KND_UNITS_PK');
    PL/SQL procedure successfully completed.
    SELECT /*+ gather_plan_statistics */id, org, count(aa) cnt
    FROM (SELECT DISTINCT id, org, aa
          FROM zzz_temp_nn, molfrelflat, (SELECT DISTINCT m.prot aa, nvl
    (org, 0) org, molf tid FROM molfprot m, (SELECT DISTINCT prot, org FROM
    protorgs WHERE trust >= 0 and decode(org,0,0,1)=1) o WHERE m.prot
    = o.prot(+))
          WHERE qid = 1 AND id = molfgrp AND molfmbr = tid)
      8  GROUP BY id, org;
            ID        ORG        CNT
            -4          8      18921
            -4          0          6
            -4          1      16229
            -4          9      13744
    SQL> select * from table(dbms_xplan.display_cursor(null,null,'ALLSTATS LAST'));
    PLAN_TABLE_OUTPUT
    SQL_ID  d63q3xdmxnun3, child number 0
    SELECT /*+ gather_plan_statistics */id, org, count(aa) cnt FROM (SELECT DISTINCT id, org, aa       FROM zzz_temp_nn, molfrelflat, (SELECT DISTINCT
    m.prot aa, nvl (org, 0) org, molf tid FROM molfprot m, (SELECT DISTINCT prot, org FROM protorgs WHERE trust >= 0 and decode(org,0,0,1)=1) o WHERE
    m.prot = o.prot(+))       WHERE qid = 1 AND id = molfgrp AND molfmbr = tid) GROUP BY id, org
    Plan hash value: 4002351125
    | Id  | Operation                                | Name                         | Starts | E-Rows | A-Rows |   A-Time   | Buffers |  OMem |  1Mem | Used-Mem |
    |   1 |  HASH GROUP BY                           |                              |      1 |      1 |      4 |00:00:59.57 |      49M|  1049K|  1049K|  445K (0)|
    |   2 |   VIEW                                   |                              |      1 |      1 |  48900 |00:00:59.58 |      49M|       |       |          |
    |   3 |    HASH UNIQUE                           |                              |      1 |      1 |  48900 |00:00:59.53 |      49M|  2745K|  1417K| 2700K (0)|
    |   4 |     NESTED LOOPS                         |                              |      1 |      1 |   3955K|00:04:17.09 |      49M|       |       |          |
    |   5 |      NESTED LOOPS                        |                              |      1 |      1 |   3965K|00:03:53.96 |      45M|       |       |          |
    |   6 |       NESTED LOOPS                       |                              |      1 |      1 |   3965K|00:03:26.20 |      41M|       |       |          |
    |   7 |        NESTED LOOPS                      |                              |      1 |      1 |   3965K|00:02:54.48 |      37M|       |       |          |
    |   8 |         NESTED LOOPS                     |                              |      1 |      1 |   3967K|00:02:30.76 |      33M|       |       |          |
    |   9 |          NESTED LOOPS                    |                              |      1 |      1 |   3967K|00:01:59.02 |      25M|       |       |          |
    |  10 |           NESTED LOOPS                   |                              |      1 |      1 |   3967K|00:01:27.28 |      17M|       |       |          |
    |  11 |            NESTED LOOPS                  |                              |      1 |      1 |   3967K|00:00:55.54 |      10M|       |       |          |
    |  12 |             NESTED LOOPS OUTER           |                              |      1 |      1 |   3967K|00:00:19.84 |    2107K|       |       |          |
    |  13 |              NESTED LOOPS                |                              |      1 |      1 |    168K|00:00:01.35 |     196K|       |       |          |
    |  14 |               NESTED LOOPS               |                              |      1 |      3 |  58463 |00:00:00.06 |     490 |       |       |          |
    |* 15 |                TABLE ACCESS FULL         | ZZZ_TEMP_NN                  |      1 |      1 |      1 |00:00:00.01 |       3 |       |       |          |
    |* 16 |                INDEX RANGE SCAN          | UNITRELFLAT_UI_UNITG_UNITM   |      1 |      3 |  58463 |00:00:00.01 |     487 |       |       |          |
    |* 17 |               TABLE ACCESS BY INDEX ROWID| UNITRELS                     |  58463 |      1 |    168K|00:00:01.62 |     196K|       |       |          |
    |* 18 |                INDEX RANGE SCAN          | UNITRELS_I_UNITG             |  58463 |     15 |    168K|00:00:00.58 |     118K|       |       |          |
    |* 19 |              TABLE ACCESS BY INDEX ROWID | PROTORGS                     |    168K|      1 |   3956K|00:00:22.46 |    1911K|       |       |          |
    |* 20 |               INDEX RANGE SCAN           | PROTORGS_UI_PROT_ORG_TIS_LOC |    168K|      1 |   3956K|00:00:05.81 |     353K|       |       |          |
    |* 21 |             INDEX RANGE SCAN             | UNITS_UI_ID_TYPE             |   3967K|      1 |   3967K|00:00:30.50 |    7935K|       |       |          |
    |* 22 |            INDEX RANGE SCAN              | UNITS_UI_ID_TYPE             |   3967K|      1 |   3967K|00:00:25.61 |    7947K|       |       |          |
    |* 23 |           INDEX RANGE SCAN               | UNITS_UI_ID_TYPE             |   3967K|      1 |   3967K|00:00:24.71 |    7947K|       |       |          |
    |* 24 |          INDEX RANGE SCAN                | UNITS_UI_ID_TYPE             |   3967K|      1 |   3967K|00:00:28.33 |    7947K|       |       |          |
    |* 25 |         TABLE ACCESS BY INDEX ROWID      | KND_UNITS                    |   3967K|      1 |   3965K|00:00:29.12 |    3967K|       |       |          |
    |* 26 |          INDEX UNIQUE SCAN               | KND_UNITS_PK                 |   3967K|      1 |   3967K|00:00:10.57 |     470 |       |       |          |
    |* 27 |        TABLE ACCESS BY INDEX ROWID       | KND_UNITS                    |   3965K|      1 |   3965K|00:00:23.86 |    3965K|       |       |          |
    |* 28 |         INDEX UNIQUE SCAN                | KND_UNITS_PK                 |   3965K|      1 |   3965K|00:00:09.29 |     470 |       |       |          |
    |* 29 |       TABLE ACCESS BY INDEX ROWID        | KND_UNITS                    |   3965K|      1 |   3965K|00:00:22.90 |    3965K|       |       |          |
    |* 30 |        INDEX UNIQUE SCAN                 | KND_UNITS_PK                 |   3965K|      1 |   3965K|00:00:09.06 |     470 |       |       |          |
    |* 31 |      TABLE ACCESS BY INDEX ROWID         | KND_UNITS                    |   3965K|      1 |   3955K|00:00:22.74 |    3965K|       |       |          |
    |* 32 |       INDEX UNIQUE SCAN                  | KND_UNITS_PK                 |   3965K|      1 |   3965K|00:00:09.22 |     470 |       |       |          |
    Predicate Information (identified by operation id):
      15 - filter("QID"=1)
      16 - access("ID"="R"."UNITG")
      17 - filter("R"."TYPE"=0)
      18 - access("R"."UNITM"="R"."UNITG")
      19 - filter("TRUST">=0)
      20 - access("R"."UNITM"="PROT")
           filter(DECODE("ORG",0,0,1)=1)
      21 - access("R"."UNITG"="UG"."ID")
      22 - access("R"."UNITG"="UG"."ID")
      23 - access("R"."UNITM"="UM"."ID")
      24 - access("R"."UNITM"="UM"."ID")
      25 - filter("KM"."TREE"=1)
      26 - access("UM"."TYPE"="KM"."ID")
      27 - filter("KG"."TREE"=1)
      28 - access("UG"."TYPE"="KG"."ID")
      29 - filter("KG"."TREE"=1)
      30 - access("UG"."TYPE"="KG"."ID")
      31 - filter("KM"."TREE"=0)
      32 - access("UM"."TYPE"="KM"."ID")
    Note
    -----

  • How to suppress the back-ground execution of a query in design mode

    hi guys,
    there is a bahaviour of the system, that I'd like to change. So, when we
    1. start EXCEL
    2. go to the designer mode to create a report
    3. first drop an InfoProvider (e query) into a cell,
    4. second - pull e.g a filter element into another cell, still being in the design mode.
    Just in this moment, the query itself has been already started in the back groud, aiming to fill the cache, I guess.
    Does anyone know how to suppress the back-ground execution? I'd like to control, when to start the reports execution.
    Thanks in advance.
    Neven

    Hello,
    There is no way to do that if you are creating thru BEx Analyzer.
    Instead use the BEx Analyzer, try to create using directly BEx Query Designer.
    In that way, the query will not be executed, until you want to...
    Thank you
    Edward John

  • Execution time of query with high variance

    I have an Oracle Database 11.2 R2 which is set up just for testing purposes, so there is no other activity except mine. Now I have a query which I ran 10 times in a row. Between the executions I always flushed BUFFER_CACHE and SHARED_POOL. The strange thing is, that the execution time of the query is strongly varying from 13 seconds up to 207 seconds. From the 10 executions I have 4 times <25 seconds and 4 times > 120 seconds.
    What could be the reason for this? As I've said, there is no other activity on the database and it is always the same query with the same parameters running on the same set of data.
    The background to this is that I would like to compare the execution time of exactly the same query with different database settings. So I thought I could just run the query ten times and use the average but I didn't expect such a high variance.
    Kind regards
    Peter

    Hi,
    for each execution, look at:
    1) plan hash value
    2) total logical I/O
    3) physical I/O
    That should give you some clues as to what's going on.
    Best regards,
    Nikolay

  • Benefit cost reporting in ad hoc query

    Is it possible to use ad hoc query to report on future dated benefit cost changes?  I have tried several different ways but have not been successful.
    I tried changing the date of the reporting period to match that of the effective date for the benefit cost change but the system still outputs the old costs.
    I also tried using the benefit cost calculation date as a selection field and then enter the effective date for benefit change but that did not work either.
    Does anyone have any insight?  Thanks in advance for your input!

    Did you ever find an answer to your question?  I am having the exact same issue.  Unless a new infotype is saved with the dates that coincide with the cost configuration change, I cannot report on the new cost via Ad hoc or SAP query.  The only thing that works is the standard health plan cost report but my users prefer to use query so they can get every field they need.

  • Slow, then fast execution of same query

    I have a test query:
    dbxml> query 'count(collection()/Quots/QuotVerificationInstance/@lastModifiedDate[.="2009-09-07"])'
    With this index:
    Index: node-attribute-substring-string for node {}:lastModifiedDate
    The first time I run the query in the shell, it takes a while:
    Query - Finished query execution, time taken = 29656ms
    The second time I run the query, it's a more acceptable speed:
    Query - Finished query execution, time taken = 735ms
    Can anyone explain the difference in search speed? The slow, fast pattern is pretty consistent (I've tried fresh shell sessions a few times and get the same initial slow search followed by the quicker one.)
    What I'm trying to do is allow on-demand generation of a table showing the number of records modified per day and per month. The test date I'm searching for above is the date of insertion of records so it returns a comparatively large result set at the moment, but 29-odd seconds is way too slow to make the query comfortable. I've added a substring index because sometimes I want a partial date search (e.g. when counting records modified per month). I remember reading that a substring index doubles as an equality index. The date is stored simply as a string, not a date type.
    What am I missing? I'd like to understand the difference in execution times, but basically I need it to run more quickly for simultaneous date queries. I'd be grateful for any pointers.
    Tim

    Hi Viyacheslav
    I think it's perhaps too much trouble for us both for me to try and share the container -- my managers would want assurances about copyright (the data is part of a previously published dictionary), and I'd have to build a smaller one as the current file is > 500MB. But thanks for your interest.
    My container setup is pretty simple. It's around 45000 small XML files added to a node container for a read only database (no environment). I have 16 indices supporting a range of different searches and a couple of reports, and the only index relevant to the @lastModifiedDate search is the node-attribute-substring-string index mentioned above (when I tried other edge or equality indexes I deleted the substring index). The query script I intended would be instantiated purely to run the one query and then die each time, so I don't see there being any chance of getting past an initial slow query if that's the behaviour. Because that first query finds around 37000 matches among the 45000 dates, it's understandable that it would take a while but I'm not sure why it speeds up in the shell from the second time round. An obvious suggestion would be that some form of optimisation is taking place in the shell, but I don't understand the workings of DBXML well enough to guess how. Even if this is the case, knowing that it happens wouldn't help me speed up my query due to the life cycle of the script.
    Perhaps I should just generate these stats on a daily basis rather than generating them on-demand, or else try a different approach at getting the counts. But thanks again for the comments.
    Tim

  • Number of Execution of Sub-Query

    Hi,
    Let suppose we have a SQL which has a sub-query in the filter NOT IN clause as shown below. I wish to know that whether for each record from Table_1 (T1),
    the inner/filter SQL will execute
    or
    It will execute only once for that session (All the records from T1).
    Meaning: Let suppose Table_1 has 5 Million records. So whether the filter/sub-query will be executed 5 Million times by Oracle Engine or It will be executed only once.
    SQL:
    SELECT T1.C1, T1.C2, T2.C3 FROM Table_1 T1
    INNER JOIN
    Table_2 T2
    ON T1.C1=T2.C1
    WHERE T1.C2 = 0 AND
    T1.C4 NOT IN(SELECT DISTINCT COLUMN_12 FROM TABLE_3 WHERE COLUMN_13 = 'VALUE');
    Best Regards,
    Mayur

    It depends on the execution plan. NOT IN can be converted to NOT EXISTS, it can be converted to an ANTI-JOIN.
    If it's converted to a hash (or merge) ANTI-JOIN the subquery is (effectively) executed once, if it's converted to a nested loop anti-join it's (effectively) executed once per row in the driving rowsource. If it's converted to a NOT EXISTS filter subquery it may be executed as much as once per row in the driving row source, it may be executed as little as once per distinct value in the driving row source. (See http://jonathanlewis.wordpress.com/2006/11/06/filter-subqueries/ for an example of the FILTER subquery count
    Regards
    Jonathan Lewis

Maybe you are looking for

  • Time Capsule "looking for backup disk" problems, running Lion on 24" iMac

    Hi, I'm having problems with my Time Capsule.  I can't get the backups to run for about a week.  The backup just says "looking for backup disk" for ever.  This is a first gen Time Capsule, and it's still working fine for two MacBooks in the house.  I

  • SRM-MDM Catalog latest version and SRM 6.0

    Hi MDM Users, could anybody tell me when will be released SRM-MDM Catalog 2.0? As I know, latest version is 1.0 Patch03. Do you have any information about release of SRM 6.0? Thanks and regards, Álmos Message was edited by:         Álmos Paksi

  • Modifying existing jar file, how?

    Hi there, I have a problem trying to modify an existing jar file. When I want to create a jar file, I use something like: REM build the application on windows, assuming the java/bin REM directory is in the path environment variable REM application is

  • Please help! How to increase font size in RemoteApp?

    I have weak-sighted user. There is some RemoteApp running on Windows Server 2008 R2 Standatd x64. I need to increase scale of fonts to 125% and use 120 dpi fonts for this user. But  increasing scale of fonts disabled on RDP Session. Option to use 120

  • Sync problem - songs appearing in wrong order

    Have been using Ipod classic with Itunes for several months with no problems. A couple of weeks ago I connected Ipod to my PC to sync and charge. rather than just putting recently added music onto my ipod as per usual, it proceeded to transfer my ful