How to improve the run time of this query

Is there any way to improve this query,
I have a table which SR_WId with atleast one subtype as 'Break Fix', 'Break/Fix','Break Fix/Corrective Maint','Break Fix-Corrective Maint'. then i can have other subtype as 'Break Fix', 'Break/Fix', 'Follow Up', 'Follw-Up','T&'||'M Break Fix','Break Fix/Corrective Maint','Break Fix-Corrective Maint'.
Let me know if this is okay or to modify it.
SELECT DISTINCT A.SR_WID AS SR_WID
FROM WC_SR_ACT_SMRY_FS A
WHERE EXISTS
(SELECT NULL FROM WC_SR_ACT_SMRY_FS B
WHERE B.ACT_TYPE = 'Maintenance'
AND B.ACT_SUBTYPE in ('Break Fix', 'Break/Fix','Break Fix/Corrective Maint','Break Fix-Corrective Maint') AND B.NBR_OF_ACTIVITIES = 1 AND B.SR_WID = A.SR_WID
GROUP BY B.SR_WID
HAVING COUNT(B.SR_WID) >= 1)
AND A.ACT_TYPE = 'Maintenance'
AND A.ACT_SUBTYPE IN ('Break Fix', 'Break/Fix', 'Follow Up', 'Follw-Up','T&'||'M Break Fix','Break Fix/Corrective Maint','Break Fix-Corrective Maint')

SELECT DISTINCT A.SR_WID AS SR_WID
           FROM WC_SR_ACT_SMRY_FS A
          WHERE EXISTS(
                   SELECT   NULL
                       FROM WC_SR_ACT_SMRY_FS B
                      WHERE B.ACT_TYPE = 'Maintenance'
                        AND B.ACT_SUBTYPE IN
                              ('Break Fix',
                               'Break/Fix',
                               'Break Fix/Corrective Maint',
                               'Break Fix-Corrective Maint')
                        AND B.NBR_OF_ACTIVITIES = 1
                        AND B.SR_WID = A.SR_WID
                   GROUP BY B.SR_WID
                     HAVING COUNT(B.SR_WID) >= 1 )
            AND A.ACT_TYPE = 'Maintenance'
            AND A.ACT_SUBTYPE IN
                  ('Break Fix',
                   'Break/Fix',
                   'Follow Up',
                   'Follw-Up',
                   'T&' || 'M Break Fix',
                   'Break Fix/Corrective Maint',
                   'Break Fix-Corrective Maint');First of all, you can omit the GROUP BY and HAVING part in the sub-select -
we already know thath the only value for B.SR_WID can be A.SR_WID and
COUNT(B.SR_WID) will always be at least 1, otherwise the sub-select will
return nothing.
As a second step, you could transform EXISTS() into IN():
SELECT DISTINCT SR_WID
           FROM WC_SR_ACT_SMRY_FS A
          WHERE SR_WID IN(
                   SELECT B.SR_WID
                     FROM WC_SR_ACT_SMRY_FS B
                    WHERE B.ACT_TYPE = 'Maintenance'
                      AND B.ACT_SUBTYPE IN
                            ('Break Fix',
                             'Break/Fix',
                             'Break Fix/Corrective Maint',
                             'Break Fix-Corrective Maint')
                      AND B.NBR_OF_ACTIVITIES = 1)
            AND ACT_TYPE = 'Maintenance'
            AND ACT_SUBTYPE IN
                  ('Break Fix',
                   'Break/Fix',
                   'Follow Up',
                   'Follw-Up',
                   'T&' || 'M Break Fix',
                   'Break Fix/Corrective Maint',
                   'Break Fix-Corrective Maint');

Similar Messages

  • How to reduce the elapsed time on this query.

    Oracle10.2.0.5 on AIX6.1.
    Here is the awrsql report of a query for a one hour window.
    Here UNBILLED has 120million records which is partitioned and subpartitioned. It has 10 partitions and 312 subpartitions. One subpartition has 10M records, 10 others have 1M each and 270 subpartitions have 360K records each. And 31 subpartitions are empty.
    And BILLED has 300K records.
    Looking at report you can see that out of 984 seconds, 958 is used for IO. Machine is PowerPC_POWER5 with 8CPU and disk storage on EMC.
    Stat Name                                Statement   Per Execution % Snap
    Elapsed Time (ms)                           984,327        5,561.2    28.6
    CPU Time (ms)                                40,760          230.3    29.8
    Executions                                      177            N/A     N/A
    Buffer Gets                               1,923,456       10,867.0    46.9
    Disk Reads                                  203,832        1,151.6    25.1
    Parse Calls                                       0            0.0     0.0
    Rows                                        106,200          600.0     N/A
    User I/O Wait Time (ms)                     958,766            N/A     N/A
    Cluster Wait Time (ms)                            0            N/A     N/A
    Application Wait Time (ms)                        0            N/A     N/A
    Concurrency Wait Time (ms)                        0            N/A     N/A
    Invalidations                                     0            N/A     N/A
    Version Count                                     1            N/A     N/A
    Sharable Mem(KB)                                 31            N/A     N/A
    SQL_ID akg45a750sh0u
    DELETE UNBILLED WHERE (MSG_ID, MSG_ID2,SPLIT_ROW_NUM) IN (SELECT MSG_ID,MSG_ID2, SPLIT_ROW_NUM FROM BILLED
    WHERE BILL_REF_NO = :B2 AND BILL_REF_RESETS = :B1 )
    Plan hash value: 3879210699
    | Id  | Operation                            | Name                          | Rows  | Bytes | Cost (%CPU)| Pstart| Pstop |
    |   0 | DELETE STATEMENT                     |                               |       |       |     1 (100)|       |       |
    |   1 |  DELETE                              | UNBILLED                      |       |       |            |       |       |
    |   2 |   NESTED LOOPS                       |                               |     1 |   112 |     0   (0)|       |       |
    |   3 |    TABLE ACCESS BY GLOBAL INDEX ROWID| BILLED                        |     1 |    65 |     0   (0)|     1 |     1 |
    |   4 |     INDEX RANGE SCAN                 | BILLED_XCB_BILL_REF_TRANS     |     1 |       |     0   (0)|       |       |
    |   5 |    INDEX UNIQUE SCAN                 | UNBILLED_PK                   |     1 |    47 |     0   (0)|       |       |
    ----------------------------------------------------------------------------------------------------------------------Is there way to improve the elapsed time( currently 5,561.2 msec per execution) of the query?
    Thanks for your time...

    user1014212 wrote:
    You're giving very interresting pointers.. Especially the one using the GTT table... Thanks...
    I was also looking from a DBA point of view, say increasing the DB_CACHE_SIZE from 5GB to 8GB as the machine has almost 32GB memory out of which 13GB is free memory. Because the timed event is "db file sequential read" which takes 95% of Total Call time.
    select * from V_$SGA_TARGET_ADVICE;
    post SQL & FORMATTED results using tags                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How to shorten the running time of NXT brick (TETRIX & MATRIX toolkit)

    Hi
    How to shorten the running time of NXT brick ?
    (TETRIX & MATRIX toolkit running time)
    Software is LabVIEW 2012 for LEGO MINDSTORMS
    Thanks.
    Solved!
    Go to Solution.
    Attachments:
    TETRIX_Toolkit_running_time.vi ‏20 KB
    MATRIX_Toolkit_running_time.vi ‏13 KB

    Hi 40123157,
    You are using the module in an appropriate way, and there is no easy way to improve the loop iteration time beyond what you have done. Here are my suggestions:
    1) i2c commands do take a long time. In your application, it may speed up if you only execute Move Motors only when the motor speed has changed.
    2) For this particular example, you are not using the output of Motor Status. If this VI doesn't need to execute it may be removed.
    3) If you must speed up execution beyond this, as an advanced user of LabVIEW, you can create a copy of the Move Motors VI and modify it as you choose. All you have to do for the 'DC Motors' input is use cluster to array on the cluster, as shown below. I think you can speed it up by executing all setup before the loop (set connection type and setup sensor), and removing calculate power value if you're only sending values between -100 and 100.  
    4) Drawing to the screen may be slowing you down here.

  • How to obtain the running time of a task?

    How to obtain the running time of a task? I want to write a program about task progress.
    My email: [email protected]
    Thanks!

    First, Thanks for your code.
    But, I want obtain running time before running it.
    Example:
    class a extends JFrame{
    a() {
    initComponent() ;
    new progressBar(this); // my fancy. (may be other type variant.)
    void initComponent() {
    class progressBar {
    JProgressBar proBar = null ;
    Timer taskTime = null ;
    Double longTime = null ;
    progressBar(JFrame frame) { //JFrame or other.
    longTime = // ??????? You know ?????
    void monitor() {
    taskTime = new Timer(1000, new ActionListener() {
    public void actionPerformed(ActionEvent event) {
    //repaint the proBar code.
    taskTime.start();
    }

  • How to disable the run-time popup menu in the sequence display on TestStand Operator Interface, that allow the use to skip the test?

    How to disable the run-time popup menu in the sequence display on TestStand Operator Interface, that allow the use to skip the test?

    Hello,
                  Regarding the skip/force pass/force fail options, when I set the ControlExecFlow to True in Teststand 3.1 and 3.5, in the Sequence Editor the menu options for skip/force pass/force fail are not active for Technician but, when I launch the Operator Interface logged with Technician the options are active. The problem is that if the technician sets one step to one of these options, and change the user to Operator, the test step remains skip/force pass.
                  Is there any possibility without modifying the Operator Interface (at programming level), to reload default values of the steps when changing the user to Operator?
    Thank you,
    Best regards,
    paio

  • Inner Join. How to improve the performance of inner join query

    Inner Join. How to improve the performance of inner join query.
    Query is :
    select f1~ablbelnr
             f1~gernr
             f1~equnr
             f1~zwnummer
             f1~adat
             f1~atim
             f1~v_zwstand
             f1~n_zwstand
             f1~aktiv
             f1~adatsoll
             f1~pruefzahl
             f1~ablstat
             f1~pruefpkt
             f1~popcode
             f1~erdat
             f1~istablart
             f2~anlage
             f2~ablesgr
             f2~abrdats
             f2~ableinh
                from eabl as f1
                inner join eablg as f2
                on f1ablbelnr = f2ablbelnr
                into corresponding fields of table it_list
                where f1~ablstat in s_mrstat
                %_HINTS ORACLE 'USE_NL (T_00 T_01) index(T_01 "EABLG~0")'.
    I wanted to modify the query, since its taking lot of time to load the data.
    Please suggest : -
    Treat this is very urgent.

    Hi Shyamal,
    In your program , you are using "into corresponding fields of ".
    Try not to use this addition in your select query.
    Instead, just use "into table it_list".
    As an example,
    Just give a normal query using "into corresponding fields of" in a program. Now go to se30 ( Runtime analysis), and give the program name and execute it .
    Now if you click on Analyze button , you can see, the analysis given for the query.The one given in "Red" line informs you that you need to find for alternate methods.
    On the other hand, if you are using "into table itab", it will give you an entirely different analysis.
    So try not to give "into corresponding fields" in your query.
    Regards,
    SP.

  • How to find the processing time of any query?

    im using oracle express edition, can anyone help me, how to find the processing time of any query?

    Trace the query and tkprof the generated trace file.
    http://download.oracle.com/docs/cd/E11882_01/server.112/e16638/sqltrace.htm#PFGRF01010

  • [Urgent!!]How to control the running time??

    Hi,
    I'm an undergraduate researcher in the University of Michigan. I used NI labVIEW FPGA on my current project and now i meet a problem.
    I have a labview code that has runs with 3 subroutines. they execute one after another for a given time period for each iteration of the entire code. that is i built them in a flat sequence structure inside a large while loop and each of the subroutine is a while loop with several subvi's in it. not that complicated but i have to specify how long each subroutine runs. now i have a problem to set that execution time. i don't know exactly what kind of timing function i shall use. i tried the "Elapsed time" function but that only works for the first iteration. from the second iteration on each subroutine only runs for once, instead of continuing to run until the given time elapsed. so i don't know how to correctly control the running time. It's reallly urgent, so could you please give me some suggestions about it? Thanks a million!!
    Xiaofei

    Thank you for your suggestion!
    sorry but that this method won't help because my code is sort of difficult to put into a for loop .
    the logic is like this: first the output is set to 0 for a user-defined amount of time (means no excitation). secondly it gets excitation and gets output but no data saving is allowed for a user-defined amount of time. at the same time, one paramater is automatically changed. (the reason for not saving data is that there is a transient response when the parameter changes). thirdly, data saving begins with the same
    parameters as before, also for a user-defined amount of time. and then after these three steps one iteration is done. for iterations there is a different parameter, the user defines the range of the parameter and the number of different values in between and the code will do the increment at equal intervals automatically. my problem now is that i don't know how to correctly control the time. i have tried various ways but no one works.
    the second problem is that i don't know how to let it run and not saving data and then saving data without changing everything else. what i have now is to call the same VI twice, once for only running and no data saving and the other for saving data. but then the problem is that in between these two routines, the output suddenly becomes zero and gets excited again after i call it.  My professor said that i cannot let the output become zero, otherwise there is no meaning in waiting for the excitation to become stablee. but then i don't know how to call a VI only once and let it do the saving for only the latter part of the running time. i have been working on this thing for two weeks now and still have no idea....Sorry the problem is long and tedious, but if anyone have any idea about it, please let me know, i will be most grateful. Thanks a million!!!

  • How to get the running time on the page

    Hello ,
    I want to display the running clock and the user who loggin in .
    Pls let me know how to get the running clock display and the username who log in.
    thakns
    kumar

    Hi,
    You can use javascript clock and substitution string APP_USER
    Place this to HTML region source
    <input type="text" id="clock" /><span>&APP_USER.</span>
    <script language="JavaScript">
    function runClock(){
    theTime = window.setTimeout("runClock()", 1000);
    var RightNow = new Date();
    var hrNow = RightNow.getHours();
    var mnNow = RightNow.getMinutes();
    var scNow = RightNow.getSeconds();
    var miNow = RightNow.getTime();
    var mon = RightNow.getMonth() + 1;
    var date = RightNow.getDate();
    var year = RightNow.getFullYear();
    var day = RightNow.getDay();
    if(hrNow == 0) {hour = 12;var ap = " AM";}
    else if(hrNow <= 11) {ap = " AM";hour = hrNow;}
    else if(hrNow == 12) {ap = " PM";hour = 12;}
    else if (hrNow >= 13) {hour = (hrNow - 12);ap = " PM";}
    if(hrNow >= 13) {hour = hrNow - 12;}
    if(mnNow <= 9) {min = "0" + mnNow;}
    else{min = mnNow}
    if (scNow <= 9) {secs = "0" + scNow;}
    else {secs = scNow;}
    var zday=new Array(7)
    if (day==0) {zday="Sunday"};
    if (day==1) {zday="Monday"};
    if (day==2) {zday="Tuesday"};
    if (day==3) {zday="Wednesday"};
    if (day==4) {zday="Thursday"};
    if (day==5) {zday="Friday"};
    if (day==6) {zday="Saturday"};
    var zmon = new Array(12)
    if (mon==1) {zmon="January"};
    if (mon==2) {zmon="February"};
    if (mon==3) {zmon="March"};
    if (mon==4) {zmon="April"};
    if (mon==5) {zmon="May"};
    if (mon==6) {zmon="June"};
    if (mon==7) {zmon="July"};
    if (mon==8) {zmon="August"};
    if (mon==9) {zmon="September"};
    if (mon==10) {zmon="October"};
    if (mon==11) {zmon="November"};
    if (mon==12) {zmon="December"};
    $x('clock').value=""+zday+", "+zmon+" "+date+", "+year+" "+hour+":"+min+":"+secs+ap+"";
    runClock();
    </script>Use styles to get look you like to input and span tag
    Br,Jari

  • How to get the CPU time of a query?

    Hello all, will someone pls tell me how to get the CPU time instead of Elapsed Time of a query?
    Thanks.

    If i am not wrong, Jonathan Lewis blogged about the changed behaviour.
    Here is short test:
    SQL> CREATE OR REPLACE FUNCTION Cpu RETURN NUMBER IS
      2    Retval NUMBER;
      3  BEGIN
      4    SELECT m.VALUE
      5    INTO      Retval
      6    FROM      V$statname s, V$mystat m
      7    WHERE  s.Statistic# = m.Statistic#
      8    AND       NAME = 'CPU used by this session';
      9    RETURN Retval;
    10  END;
    11  /
    Function created.
    cat cpu_test.sql
    DECLARE
    TYPE t IS TABLE OF NUMBER;
    tt t;
    BEGIN
    dbms_output.put_line(cpu());
    SELECT COUNT(*) over(PARTITION BY owner) BULK COLLECT INTO tt FROM all_objects;
    dbms_output.put_line(cpu());
    SELECT COUNT(*) over(PARTITION BY object_type) BULK COLLECT INTO tt FROM user_objects;
    dbms_output.put_line(cpu());
    SELECT COUNT(*) over(PARTITION BY owner) BULK COLLECT INTO tt FROM dba_objects;
    dbms_output.put_line(cpu());
    END;
    SQL> select * from v$version
      2  /
    BANNER
    Oracle9i Enterprise Edition Release 9.2.0.6.0 - Production
    PL/SQL Release 9.2.0.6.0 - Production
    CORE    9.2.0.6.0       Production
    TNS for Linux: Version 9.2.0.6.0 - Production
    NLSRTL Version 9.2.0.6.0 - Production
    SQL> @cpu_test
    0
    0
    0
    0
    PL/SQL procedure successfully completed.
    SQL> @cpu_test
    106
    106
    106
    106
    PL/SQL procedure successfully completed.
    SQL> select * from v$version
      2  /
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Prod
    PL/SQL Release 10.2.0.3.0 - Production
    CORE    10.2.0.3.0      Production
    TNS for Linux: Version 10.2.0.3.0 - Production
    NLSRTL Version 10.2.0.3.0 - Production
    SQL> set serveroutput on
    SQL> @cpu_test
    1
    129
    130
    145
    PL/SQL procedure successfully completed.
    SQL> @cpu_test
    145
    273
    275
    290
    PL/SQL procedure successfully completed.Best regards
    Maxim

  • How to find the execution time of a query?

    hi guys,
    i need to find the execution time of a query.
    i tried finding it in rsrt but couldn find the execution time.
    pleasse let me know the way to do it..
    regards
    sagar

    Hi sagar,
    If you want to know the frontend time, first of all you need to maitain the BW Statistics. To maintain you have to go the respective target and click on it. Go to the tools, select BW Statistics of infoprovider. It pop ups a window there you find two check boxes 1) WHM and 2) Front end time. Check both.
    Now Exe query and close the analyzer. Then go to SE11 table RSDDSTAT. There is one field which displays Frentend time.
    OR
    Go to STO3 here also you can analys the frontend time.
    If you feel useful Assign Pts.
    Regards,
    Vishal

  • How to know the run time of a program..?

    Hi Gurus,
    How to know the exact run time of a program....?
    Suppose i've a program....I've changed the code to improve the performance.
    Now i want to compare run time of older and new one...How to do this...?
    Pls help me ....
    Thanks and Regards,
    Nagarjuna

    Hi,
    go thru the below mentioned code............
    data:   start TYPE i,
              end TYPE i,
              dif TYPE i.
    GET RUN TIME FIELD start.
    SELECT SINGLE bukrs belnr gjahr blart budat
    FROM bkpf
    INTO (cc, doc, fy, doc_ty, pst_dt)
    WHERE bukrs = p_bukrs
    AND belnr = p_belnr
    AND gjahr = p_gjahr.
    GET RUN TIME FIELD end.
    dif = end - start.
    WRITE: /001 'Time for select',
    067 ':', dif, 'microseconds'.
    Reward all helpful answers.
    Thanks

  • How to improve the execution time of my VI?

    My vi does data processing for hundreds of files and takes more than 20 minutes to commplete. The setup is firstly i use the directory LIST function to list all the files in a dir. to a string array. Then I index this string array into a for loop, in which each file is opened one at a time inside the loop, and some other sub VIs are called to do data analysis. Is there a way to improve my execution time? Maybe loading all files into memory at once? It will be nice to be able to know which section of my vi takes the longest time too. Thanks for any help.

    Bryan,
    If "read from spreadsheet file" is the main time hog, consider dropping it! It is a high-level, very multipurpose VI and thus carries a lot of baggage around with it. (you can double-click it and look at the "guts" )
    If the files come from a just executed "list files", you can assume the files all exist and you want to read them in one single swoop. All that extra detailed error checking for valid filenames is not needed and you never e.g. want it to popup a file dialog if a file goes missing, but simply skip it silently. If open generates an error, just skip to the next in line. Case closed.
    I would do a streamlined low level "open->read->close" for each and do the "spreadsheet string to array" in your own code, optimized to the exact format of your files. For example, notice that "read from spreadheet file" converts everything to SGL, a waste of CPU if you later need to convert it to DBL for some signal processing anyway.
    Anything involving formatted text is not very efficient. Consider a direct binary file format for your data files, it will read MUCH faster and take up less disk space.
    LabVIEW Champion . Do more with less code and in less time .

  • How to reduce the fetch time of this sql?

    Here is the SQL, three-table join and joining conditions are:
    ms_ets_cntrl.ims_cntrt_oid=ims_alctn.ims_alctn_oid
    ims_alctn.ims_trde_oid=ims_trde.ims_trde_oid
    SELECT 'MCH' Type, ims_ets_cntrl.STTS tp_stts, count(*) Count  FROM ims_ets_cntrl  where ims_ets_cntrl.ims_cntrt_oid in
    (select ims_alctn.ims_alctn_oid  FROM ims_alctn, ( select ims_trde.ims_trde_oid from ims_trde
    where ( IMS_TRDE.IMS_TRDE_RCPT_DTTM  >= TO_DATE('10/29/2009 00:00', 'MM/DD/YYYY HH24:MI') AND IMS_TRDE.IMS_TRDE_RCPT_DTTM <= (TO_DATE('11/5/2009 23:59', 'MM/DD/YYYY HH24:MI')) )
    AND (IMS_TRDE.GRS_TRX_TYPE IN ('INJECTION','WITHDRAWAL','PAYMENT') OR IMS_TRDE.SSC_INVST_TYPE = 'FC' AND  1=1  and IMS_TRDE.SERVICE_TYPE='FS' )) TRDE
    where IMS_ALCTN.IMS_TRDE_OID=TRDE.IMS_TRDE_OID) and ims_ets_cntrl.outbnd_dest = 'ETD' group by ims_ets_cntrl.STTSOptimizer and related parameter info:
    SQL> show parameter optimizer
    NAME                                 TYPE        VALUE
    optimizer_dynamic_sampling           integer     1
    optimizer_features_enable            string      9.2.0
    optimizer_index_caching              integer     0
    optimizer_index_cost_adj             integer     100
    optimizer_max_permutations           integer     2000
    optimizer_mode                       string      CHOOSE
    SQL>select pname, pval1, pval2 from sys.aux_stats$ where sname='SYSSTATS_INFO';
    DSTART          11-16-2009 10:23
    DSTOP          11-16-2009 10:23
    FLAGS     1     
    STATUS          NOWORKLOADHere is autotrace output:
    Execution Plan
       0      SELECT STATEMENT Optimizer=CHOOSE
       1    0   SORT (GROUP BY)
       2    1     VIEW
       3    2       SORT (UNIQUE)
       4    3         TABLE ACCESS (BY INDEX ROWID) OF 'IMS_ETS_CNTRL'
       5    4           NESTED LOOPS
       6    5             NESTED LOOPS
       7    6               TABLE ACCESS (BY INDEX ROWID) OF 'IMS_TRDE'
       8    7                 INDEX (RANGE SCAN) OF 'IMS_TRDE_INDX4' (NON- UNIQUE)
       9    6               TABLE ACCESS (BY INDEX ROWID) OF 'IMS_ALCTN'
      10    9                 INDEX (RANGE SCAN) OF 'IMS_ALCTN_INDX1' (NON  -UNIQUE)
      11    5             INDEX (RANGE SCAN) OF 'IMS_ETS_CNTRL_INDX1' (NON  -UNIQUE)
    Statistics
              0  recursive calls
              0  db block gets
         244608  consistent gets
          58856  physical reads
              0  redo size
            497  bytes sent via SQL*Net to client
            499  bytes received via SQL*Net from client
              2  SQL*Net roundtrips to/from client
              2  sorts (memory)
              0  sorts (disk)
              1  rows processedHere is TKPROF output:
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.00       0.00          0          0          0           0
    Execute      1      0.00       0.00          0          0          0           0
    Fetch        2      4.85     129.72      53863     244608          0           1
    total        4      4.85     129.72      53863     244608          0           1
    Misses in library cache during parse: 1
    Optimizer goal: CHOOSE
    Parsing user id: 63 
    Rows     Row Source Operation
          1  SORT GROUP BY
      12972   VIEW 
      12972    SORT UNIQUE
      12972     TABLE ACCESS BY INDEX ROWID IMS_ETS_CNTRL
      46236      NESTED LOOPS 
      19134       NESTED LOOPS 
      19744        TABLE ACCESS BY INDEX ROWID IMS_TRDE
    176922         INDEX RANGE SCAN IMS_TRDE_INDX4 (object id 34099)
      19134        TABLE ACCESS BY INDEX ROWID IMS_ALCTN
      19134         INDEX RANGE SCAN IMS_ALCTN_INDX1 (object id 34094)
      27101       INDEX RANGE SCAN IMS_ETS_CNTRL_INDX1 (object id 34101)
    ********************************************************************************Explain plan output:
    PLAN_TABLE_OUTPUT
    | Id  | Operation                         |  Name                | Rows  | Bytes | Cost  |
    |   0 | SELECT STATEMENT                  |                      |       |       |       |
    |   1 |  SORT GROUP BY                    |                      |       |       |       |
    |   2 |   VIEW                            |                      |       |       |       |
    |   3 |    SORT UNIQUE                    |                      |       |       |       |
    |*  4 |     TABLE ACCESS BY INDEX ROWID   | IMS_ETS_CNTRL        |       |       |       |
    |   5 |      NESTED LOOPS                 |                      |       |       |       |
    |   6 |       NESTED LOOPS                |                      |       |       |       |
    |*  7 |        TABLE ACCESS BY INDEX ROWID| IMS_TRDE             |       |       |       |
    |*  8 |         INDEX RANGE SCAN          | IMS_TRDE_INDX4       |       |       |       |
    |   9 |        TABLE ACCESS BY INDEX ROWID| IMS_ALCTN            |       |       |       |
    |* 10 |         INDEX RANGE SCAN          | IMS_ALCTN_INDX1      |       |       |       |
    |* 11 |       INDEX RANGE SCAN            | IMS_ETS_CNTRL_INDX1  |       |       |       |
    Predicate Information (identified by operation id):
       4 - filter("IMS_ETS_CNTRL"."OUTBND_DEST"='ETD')
       7 - filter("IMS_TRDE"."GRS_TRX_TYPE"='INJECTION' OR "IMS_TRDE"."GRS_TRX_TYPE"='WITHD
                  RAWAL' OR "IMS_TRDE"."GRS_TRX_TYPE"='PAYMENT' OR "IMS_TRDE"."SSC_INVST_TY
                  PE"='FC' AND "IMS_TRDE"."SERVICE_TYPE"='FS')
       8 - access("IMS_TRDE"."IMS_TRDE_RCPT_DTTM">=TO_DATE('2009-10-29 00:00:00', 'yyyy-mm-
                  dd hh24:mi:ss') AND "IMS_TRDE"."IMS_TRDE_RCPT_DTTM"<=TO_DATE('2009-11-05
                  23:59:00', 'yyyy-mm-dd hh24:mi:ss')
      10 - access("IMS_ALCTN"."IMS_TRDE_OID"="IMS_TRDE"."IMS_TRDE_OID")
      11 - access("IMS_ETS_CNTRL"."IMS_CNTRT_OID"="IMS_ALCTN"."IMS_ALCTN_OID")
    Note: rule based optimizationCould you please help tune this sql?
    How can I reduce the elapsed time? How can I reduce query read?
    If there is any other info that you need, please let me know!
    thank you very much!

    What exactly is this logic meant to do?
    AND    (ims_trde.grs_trx_type IN ('INJECTION', 'WITHDRAWAL', 'PAYMENT')
            OR ims_trde.ssc_invst_type = 'FC'
            AND ims_trde.service_type = 'FS')is that really:
    AND    (ims_trde.grs_trx_type IN ('INJECTION', 'WITHDRAWAL', 'PAYMENT')
            OR ims_trde.ssc_invst_type = 'FC')
    AND    ims_trde.service_type = 'FS'or is it maybe:
    AND   (ims_trde.grs_trx_type IN ('INJECTION', 'WITHDRAWAL', 'PAYMENT')
           OR (ims_trde.ssc_invst_type = 'FC'
               AND ims_trde.service_type = 'FS'))?

  • How to set the running time of Thread??

    Hello all
    i am new and fresh student to learn Java.
    i want to set a limit time to run a thread.

    public void interrupt()
    Interrupts this thread.
    First the checkAccess method of this thread is invoked, which may cause a SecurityException to be thrown.
    If this thread is blocked in an invocation of the wait(), wait(long), or wait(long, int) methods of the Object class, or of the join(), join(long), join(long, int), sleep(long), or sleep(long, int), methods of this class, then its interrupt status will be cleared and it will receive an InterruptedException.
    If this thread is blocked in an I/O operation upon an interruptible channel then the channel will be closed, the thread's interrupt status will be set, and the thread will receive a ClosedByInterruptException.
    If this thread is blocked in a Selector then the thread's interrupt status will be set and it will return immediately from the selection operation, possibly with a non-zero value, just as if the selector's wakeup method were invoked.
    If none of the previous conditions hold then this thread's interrupt status will be set.
    Throws:
    SecurityException - if the current thread cannot modify this thread
    to quote the api
    but in your case Aldaris it would have no effect
    but if you wrote the code as..public void run(){
    while(!interrupted()){
      System.out.println("Pete_The_Hat");
    }then it would break the loop :-)

Maybe you are looking for

  • XML IN/Out via mod_plsql

    Hi, how can i get an xml-datagram using the mod_plsql cartridge ? Output is no problem (using http.print and the xml-packages). :-) But Input is only possible by using a cgi-variable witch contains the whole XML-datagram. :-< Is there a posibility to

  • Dual apple 24" led possible?

    i'm thinking of picking up a new mac mini to drive 2 apple 24" led. here are my questions: 1. is there an hdmi to mini display port adapter that i can use to drive the 2nd 24" led? if so, how is the performance? 2. is there anyway i can output audio

  • Document Sequencing in Directory Browse Help

    I need to resequence the order of the documents (cards) view when in browse mode in the Documents Directory. I need to reorder them by the card name instead of ordering by the cards ObjectID, in which is by default its sequencing them now. What do I

  • Application Manager in partial service, date format exception

    Hi; I was pulling MIVR logs as I see the Application Manager is in partial service.  I see an exception of formating the date, but I'm not sure where to go to correct it or if that is even the right thing to focus on.  Kind of new to looking at these

  • Should I bother with SAFARI?

    I recently got this iBook with SAFARI installed so I've been trying it out. Up til now its been Explorer which I've had no real complaints about despite many views to the contrary. So far I'm sadly unimpressed, nay peeved at how badly it works/doesn'