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                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Similar Messages

  • 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 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');

  • 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

  • How to display the elapsed time of a video (event video) in Captivate 6

    I have a Captivate 6 project which includes two separate videos and I am wondering how I can display an elapsed time for the videos - preferably one that stops if the individual stops the video.

    Hello and welcome to the forum,
    Are you talking about an inserted video, or about the Captivate file itself? I'm asking this because a lot of users refer to a published CP-file as a video.
    'Elapsed time': is this the real time spent by the user, or the time as you can see in the TOC (developer's time)? I blogged once about the difference.
    Lilybiri

  • 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 reduce the Logout time in IDM

    Hi Everyone,
    Help me in Solving the issue.
    When i click on the logout button of the end user interface in sun idm, it is taking 20 secs to come back to the login page (login.jsp) which is causing very much delay in the process. I want to reduce this time. Dont know exactly what is the backend process.
    Kindly help me if you know any solution for the same.
    Thank you in advance.

    Srikanth,
    It would be better to use a database table(s) to store your audit trail information than an xml file, which could grow beyond a manageable size and then require housekeeping efforts and file rolling, etc.  It would also be much easier to query user related information out of the logs, pareto charts for failed vs. successful login attempts, etc. if the data was stored in a database.
    Have you considered modifying the Relogin.jsp page link in the portal's sub-menu bar?  How about making your own version of this web page and changing the link pointer?  Keep in mind that whatever result you come up with here will need a significant update for NetWeaver UME compatibility in version 12.0.
    Regards,
    Jeremy

  • How to reduce the cloning time if using cold backup?

    Hi,
    We are using EBS r12 (12.0.6) with database 10.2.0.3 in Linux Redhat 4 32-bit envoirnment.
    Our datbase size is around 480 GB and we are facing the issues to provide the clone to my consultants for meet the target timelines in given time.
    (Source:)---- Production Dell R900 Server machine having 32-GB RAM and 8 Quard Core CPU's.
    (Target:)---- Clone Dell 2950 Server machine having 16-GB RAM and 4-Quard Core CPU's.
    Currectly we are taking cold backup like:
    1: Auto shutdown EBS r12 database nighthy at 12:00 AM daily and compress the backup using tar utility in linux. This process takes 6:00 hours aprox:
    2: After that we move compressed file to clone machine and then uncompressed it, and this process takes 5:00 hours aprox.
    3: And performe standard cloning steps.
    Questions:
    1: How to reduce time of this backup process?
    3: Is there any other way to reduce the cloning process.
    2: What type of backup oracle recommended to their customers for this type of process?
    Thanks.

    1: How to reduce time of this backup process?Without using third party tools, it might be hard to tune the timing of compressing/uncompressing the file.
    Have you tried to use scp command? This would help if your network throughput is acceptable.
    3: Is there any other way to reduce the cloning process.Since the main issue you have with the copy, then you might copy the files remotely from the source to the target, or using any other storage/backup tools (like file system snapshot).
    2: What type of backup oracle recommended to their customers for this type of process?Oracle does not recommend any type of backup as the tools used are not Oracle products.
    Thanks,
    Hussein

  • Oracle 10g: How to reduce the select * time

    Hello,
    We have 10 million entries in our database (Oracle 10g in windows 32 bit machine.)
    The execution of 'select * ....' takes 3 to 4 hour. Is there any way to reduce this time.
    Is any tool available which can read the oracle export data and produce the output in text file format.
    or any idea ?
    Thanks
    With Regards
    Hemant.

    hem_kec wrote:
    Hello EdStevens
    Is that 3 to 4 hours scrolling data past your screen?Answer: The Oracle is taking 3-4 hr to produce the output.
    OK, let me try again. Where is the output being directed? To the screen? To a file?
    The reason I ask is that often people will say "It takes n minutes to run this query" when in fact Oracle is producing the result set in a few seconds and what is taking n minutes is to run the results past the screen.
    You should take a statspack report while the query is running and see where it is spending its time.
    >
    That's a different problem. I assume by "export data" you mean a .dmp file created by exp or expdp? If so what do you hope to achieve by outputting it in text format? What is the business problem to be solved?Answer: Since customer want to read all 10 milion entries. so we are think if we can dump (Oracle export) the data and using some tool (not Oracle) to read the data so there is no wait for the customer.As stated, a dmp file is oracle proprietary binary file that exists solely to transport data across platforms/versions. It is not suitable for your purpose. You are far better off finding where the current query is spending its time than looking for some kludge. 10 million rows of data is still 10 million rows of data. Do you think extracting it from the db, storeing it in some other format, and having some other tool read it off of disk in that format is going to be faster than simply selecting it from the db -- asking the db to do what it was designed to do?
    >
    >
    Thanks
    With Regards
    Hemant.

  • How to find the elapsed time between 2 events ?

    I want to use the robot class and I have register all events in a file but when I use the Robot. It isn't synchronous. So I should find th elapsed time between two events for reproducing them with the method delay of the class Robot.
    Thanks

    It sounds like you want to reproduce the events with varying time between the events? This is a good idea for a couple of reasons 1) it's possible to enqueue events so quickly that Robot gets ahead of the Java GUI, and 2) every human does their mouse/keyboard activity at varying (and relatively slow, relative to the computer that is) rates of speed. It would help make a more realistic interaction to vary the speed of event reproduction.
    Since you can't control the amount of time between the call to Robot and when the event arrives in the application, you can't be ultimately precise about this. You'll have to accept a teensy bit of slop in the process and just live with it.
    That is ... you can do something like robot.method1() .. Thread.sleep(1) .. robot.method2() .. Thread.sleep(1) ... and that will give slight delays. If you vary the value for Thread.sleep you can vary the event reproduction speed. Early in the development of Robot I experimented with something like this - I set up an EventQueue listener to capture all mouse/keyboard events (remember that each comes with a timestamp) and then reproduced events using the time intervals from the captured events to control the Thread.sleep times between Robot calls. It worked pretty well, and the mouse would dance around in the same way I moved the mouse around.
    - David

  • How to stop the "Elapsed Time" counting without stop the program running?

    我使用Labview 8.2,配合USB DAQ來做測試治具。目的:
    當檢測到某個電壓(Analog Input)到達某個電壓值(5V)之後,開始啟動計時。若是在15秒之內,另一個電壓值降為0之後為正常​,此時停止計時(但是數值不能歸零);若是超過15秒還沒有降到0伏,則表示錯誤,此時亮起紅色 indicator警示,但是時間仍然繼續計時,直到電壓降到0為止才停(但是數值不能歸零)。
    我使用 Elapsed Time 模組來使用,可是問題是如何讓該模組停止計時同時不能將時間歸零?因為此模組只有 "Reset" 控制功能,一但將條件結果輸入到 Reset input 之後,電壓達到零之後就會將此 Elapsed Time 歸零了。有沒有解決辦法?

    Elapsed Time 確實會將時間reset,如果你想要保留時間的話其實有很多做法
    例如使用 tick count,他會顯示出相對時間數值,先放一個tick count在迴圈開始前
    記得用sequence以確保他會在回區尚未開始運作前先記錄時間
    然後再放一個tick count在迴圈內,再用case或select讓電壓等於零時記錄下tick count的值
    再將兩者相減即可
    Chris

  • How to reduce the open time of Ms proejct 2010 plans which are taking 6 minutes to open.

    In our company there is many plans which are uploaded in Project server 2010.
    all linking to each other and in master plan all also link with master project.
    when we open any project plan in Ms Project 2010 then it is taking 5 to 7 minutes time.
    I dont know why . it's too much time.

    Is this issue specific to one master project? Do you have MS recommended db maintenance plan in place. Try updating database statics  by executing  SP_updatestats on all 4 project databases
    Hrishi Deshpande Senior Consultant

  • How to get the execution time of a query

    Hi,
    Environment: 10.2.0.4.0
    Just wondering how I can get the query execution time? I am not interested in the query output nor do I want the statistics, just the execution time?
    Any suggestions will be appreciated
    Thanks in advance
    rogers42

    If you're using SQL*Plus
    SQL> set autotrace traceonly
    SQL> set timing on
    SQL> <<your query here>>SQL*Plus will fetch all the data and then report the query plan, execution statistics, and elapsed time. It will not display the actual data.
    SET TIMING ON alone tells SQL*Plus to display the execution time of each SQL statement-- the problem is that it also displays all the data which can skew the results because you're including the time required by SQL*Plus to pipe a bunch of data to the screen.
    Justin

  • How to remove the OR clause in this query?

    Hello Everyone,
    I have this query where i have a lot of joins and in the where clause there is a ISNULL and conditions based on OR clause.
    How to remove the use of the OR clause which may cause performance problems? Can anyone suggest a method to remove the OR clause?
    select RS.PLANNEDSTART,
    OD.ESTSHIPDATE
    FROM TABLE1 RS(NOLOCK)
         INNER JOIN TABLE2 SS(NOLOCK)
         ON RS.ID1             = SS.ID1
         INNER JOIN TABLE3 AM(NOLOCK)
         ON AM.KEYID        = SS.KEYID
         INNER JOIN TABLE4 OD(NOLOCK)
         ON SS.KEYID= OD.KEYID
        INNER JOIN TABLE 8 DR
       ON
    WHERE              (isnull(RS.DATE1,'1970-01-01 00:00:00.000') ='1970-01-01 00:00:00.000'
                     AND OD.DATE1 between @Beginning_Route_Date and @Ending_Route_Date)
                 OR
                 RS.DATE1!='1970-01-01 00:00:00.000'
                   AND RS.DATE1 BETWEEN  @Beginning_Route_Date and @Ending_Route_Date)              
    Regards
    Gautam S
    Gautam S

    this is one way avoiding OR clause
    WHERE CASE WHEN isnull(RS.DATE1,'1970-01-01 00:00:00.000') ='1970-01-01 00:00:00.000'
    THEN OD.DATE1 ELSE RS.DATE1 END between @Beginning_Route_Date and @Ending_Route_Date)
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

Maybe you are looking for

  • JTable how to set cell ediatble false

    - Can teach me JTable how to set cell ediatble false? - And I'm not so understand about following method and sentence... addRowSelectionInterval(int index0, int index1) Adds the rows from index0 to index1, inclusive, to the current selection. - Then

  • Linking opportunity status to follow-up quotation status

    Hello,   I have a project requirement where I need the status of the opportunity set automatically based on the status of the quotation which was created as a follow-up to the opportunity. e.g.If the status of the quotation is set as 'Completed', the

  • Color blender tool and other questions

    Hey. I've got Photoshop CS4, which I've been using pretty successfully for digital and pixel art, but there's still a lot to the program that's unknown to me, and trying to google up an answer isn't getting me anywhere. I've got a few questions. Is t

  • PS9 - Face recognition just stopped working

    Hello, I'm kind of desperate, I just installed PS9 on my PC and at first the face recognition feature worked well. Than I realize there was stuff missing in my catalogue (sorry I have the french version) so I recreated a new one. When I try ti use th

  • FCE not seeing new Live Type files correctly... (Leopard issue?)

    There appears to be a problem in LiveType and FCE as of Leopard. LiveType files created BEFORE Leopard was installed import fine, but files created AFTER Leopard was installed will not import and return an error: File Error. 1 File Recognized. 0 Acce