How to know the query execution time

Hi All,
I want to know the execution time taken for a particular query, How should i get that information ?
say for example,
select * from emp
after getting the result, i want to know the time taken for completing the execution.
How ?
Inputs are welcome !

BTW it was already written in a response to you yestreday:
Re: Query Plan
Gints Plivna
http://www.gplivna.eu

Similar Messages

  • How to know exact query execution time.

    Hi,
    I want to know what is exact query execution time which excludes network access, constructing results. Please suggest me.
    Thanks in advance,
    Satish.G

    Not sure I know what you really want, but if this is a testing phase sort of thing and you are running on unix, there is the time command.
    If you want something that is part of your application, you can run a timer in a separate Thread - for approximate time.
    If you want more precise time, you can use java.util.Date - it has a method getTime(), which you can use before processing and again after processing and subtract the former from the later.

  • How to get the query execution time

    Hi,
    I am new to oracle and I am trying to get the execution time of a query.I tried the command set timing on and executed the query.But,the time it gives me is including the display of results.In my case,I ran a query against 50 million records and it is taking around 5 hours to display all the results.I like to know,how much time it take just to execute the query?Please help.
    Thanks
    Ravi.

    Maybe this way ?
    TEST@db102 SQL> set timing on
    TEST@db102 SQL> set autotrace traceonly
    TEST@db102 SQL> select * from foo;
    332944 rows selected.
    Elapsed: 00:00:29.04
    Execution Plan
    Plan hash value: 1245013993
    | Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT  |      |   274K|    46M|  1071   (5)| 00:00:13 |
    |   1 |  TABLE ACCESS FULL| FOO  |   274K|    46M|  1071   (5)| 00:00:13 |
    Note
       - dynamic sampling used for this statement
    Statistics
            288  recursive calls
              0  db block gets
          26570  consistent gets
           4975  physical reads
              0  redo size
       35834383  bytes sent via SQL*Net to client
         244537  bytes received via SQL*Net from client
          22198  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
         332944  rows processed
    TEST@db102 SQL>                                                                               

  • How to reduce the query execution time

    hai all,
    We have created query on Purchasing Cube 0PUR_C01 for
                                Purchase Order (PO) analysis for single vendor materials, but it is taking long time to execute (about 45 sec...).
    In the above Query we have used the following things:
    In Columns:
    i) Exceptional aggregation for maximum & minimum PO Net Price using reference characteristic as Calendar Day.
    ii) Minimum PO Price value we have multiplied with Actual GR Quantity for the calculation of Impact of Lowest PO Net Price.
    iii) Number of vendors calculated key figure.
    In Rows:i)     Only Material
    In Filters:
    i)     Plant with variable select Option u2013 Optional.
    ii)     Calendar Year / Month with Select Option u2013 Optional.
    iii)     Material with excluded Unassigned (#).
    iv)     Vendor with excluded Unassigned (#).
    Following are we have used for Performance:
    i)     Aggregates using Propose from query (only for this query).
    ii)     Partitioning on Calendar Year / Month (For 1 year 14 partitions) i.e. (04.2007 to 03.2008).
    iii)      Collapse.
    iv)     In RSRT we have set the following properties
    Read Mode = H
    Req.Status  = 0
    Catch Mode = 4
    Persistence Mode = 3 (BLOB)
    Optimization mode = 0.
    Our inputs to this Query:
    i)     We are passing plant range 1201 to 1299.
    ii)     Calendar Year / Month 04.2007 to 03.2008.
    So please suggest me how to reduce the execution time.
    please help me.
    Thanks,
    kiran manyam

    Hi,
    First of all its a complete question with all the details. Good work.
    As you partitioned the cube based on calmonth and you are also giving calmonth in selection, it will definitely work towards improved query performance.
    As you are putting plant values in the selection, is there any aggregate available on plant characteristics? If not creating a aggregate on plant will help.
    Regards,
    Yogesh

  • Oracle View that stores the Query execution time

    Hi Gurus
    i m using Oracle 10G in Unix. I wudiold like to know which Data dictionary view stores the execution of a query. If it is not stored then hw to find the query execution time other than (Set timing on) command. What is the use of elapsed time and what is the difference between execution time and elapsed time? How to calculate the execution time of a query.
    THanks
    Ram

    If you have a specific query you're going to run in SQL*Plus, just do
    a 'set timing on' before you execute the query.
    If you've got application SQL coming in from all over the place, you can
    identify specific SQL in V$SQL/ and look at ELAPSED_TIME/EXECUTIONS
    to get an average elapsed time.
    If you've got an application running SQL, and you need to know the
    specific timing of a specific execution (as opposed to an average),
    you can use DBMS_SUPPORT to set trace in the session that your
    application is running in, and then use TkProf to process the resulting
    trace file.

  • Need to know how to find the last execution time for a function module

    HI all
    I need to know
    1) How to find out the last execution time of the function module ?
      say for eg. I have executed a func. module at 1:39pm. How to retrieve this time  (1:39pm)
    2) I have created 3 billing document in tcode VF01 i.e 3 billing doucment no. would be created in SAP TABLE "VBRP" b/w 12am to 12:30 am.
    How to capture the latest SAP database update b/w time intervals?
    3) Suppose I am downloading TXT file using "GUI_DOWNLOAD" and say in 20th record some error has happened. I can capture the error using the exception.
    Is it possible to run the program once again from 21st records ? All this will be running in background...
    Kindly clarify....
    Points will be rewarded
    Thanks in advance

    1.Use tcode STAT input as Tcode of Fm and execute .
    2. See the billing documents are created in table VBRk header and there will always be Creation date and time.
    VBRk-Erdat "date ., u can check the time field also
    So now if u talk the date and time we can filter then display the records in intervals.
    3. with an error exeption how is my txt download finished .
    once exception is raised there will not be a download .
    regards,
    vijay

  • How to get the total execution time from a tkprof file

    Hi,
    I have a tkprof file. How can I get the total execution time. Going through the file i guess the sum of "Total Waited" would give the total time in the section "Elapsed times include waiting on following events:"
    . The sample of tkprof is given below.
    SQL ID: gg52tq1ajzy7t Plan Hash: 3406052038
    SELECT POSTED_FLAG
    FROM
    AP_INVOICE_PAYMENTS WHERE CHECK_ID = :B1 UNION ALL SELECT POSTED_FLAG FROM
      AP_PAYMENT_HISTORY APH, AP_SYSTEM_PARAMETERS ASP WHERE CHECK_ID = :B1 AND
      NVL(APH.ORG_ID, -99) = NVL(ASP.ORG_ID, -99) AND
      (NVL(ASP.WHEN_TO_ACCOUNT_PMT, 'ALWAYS') = 'ALWAYS' OR
      (NVL(ASP.WHEN_TO_ACCOUNT_PMT, 'ALWAYS') = 'CLEARING ONLY' AND
      APH.TRANSACTION_TYPE IN ('PAYMENT CLEARING', 'PAYMENT UNCLEARING')))
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.00       0.00          0          0          0           0
    Execute    442      0.08       0.13          0          0          0           0
    Fetch      963      0.22       4.72        350      16955          0         521
    total     1406      0.31       4.85        350      16955          0         521
    Misses in library cache during parse: 1
    Optimizer mode: ALL_ROWS
    Parsing user id: 173     (recursive depth: 1)
    Number of plan statistics captured: 1
    Rows (1st) Rows (avg) Rows (max)  Row Source Operation
             1          1          1  UNION-ALL  (cr=38 pr=3 pw=0 time=139 us)
             1          1          1   TABLE ACCESS BY INDEX ROWID AP_INVOICE_PAYMENTS_ALL (cr=5 pr=0 pw=0 time=124 us cost=6 size=12 card=1)
             1          1          1    INDEX RANGE SCAN AP_INVOICE_PAYMENTS_N2 (cr=4 pr=0 pw=0 time=92 us cost=3 size=0 card=70)(object id 27741)
             0          0          0   NESTED LOOPS  (cr=33 pr=3 pw=0 time=20897 us)
             0          0          0    NESTED LOOPS  (cr=33 pr=3 pw=0 time=20891 us cost=12 size=41 card=1)
             1          1          1     TABLE ACCESS FULL AP_SYSTEM_PARAMETERS_ALL (cr=30 pr=0 pw=0 time=313 us cost=9 size=11 card=1)
             0          0          0     INDEX RANGE SCAN AP_PAYMENT_HISTORY_N1 (cr=3 pr=3 pw=0 time=20568 us cost=2 size=0 card=1)(object id 27834)
             0          0          0    TABLE ACCESS BY INDEX ROWID AP_PAYMENT_HISTORY_ALL (cr=0 pr=0 pw=0 time=0 us cost=3 size=30 card=1)
    Elapsed times include waiting on following events:
      Event waited on                             Times   Max. Wait  Total Waited
      ----------------------------------------   Waited  ----------  ------------
      db file sequential read                       350        0.15          4.33
      Disk file operations I/O                        3        0.00          0.00
      latch: shared pool                              1        0.17          0.17
    ********************************************************************************

    user13019948 wrote:
    Hi,
    I have a tkprof file. How can I get the total execution time.
    call count cpu elapsed disk query current rows
    total 1406 0.31 4.85 350 16955 0 521TOTAL ELAPSED TIME is 4.85 seconds from line above

  • How to obtain the Query Response Time of a query?

    Given the Average Length of Row of tables and the number of rows in each table,
    is there a way we get the query response time of a query involving
    those tables. Query includes joins as well.
    For example, suppose there 3 tables t1, t2, t3. I wish to obtain the
    time it takes for the following query:
    Query
    SELECT t1.col1, t2.col2
    FROM t1, t2, t3
    WHERE t1.col1 = t2.col2
    AND t1.col2 IN ('a', 'c', 'd')
    AND t2.col1 = t3.col2
    AND t2.col1 = t1.col1 (+)
    ORDER BY t1.col1
    Given are:
    Average Row Length of t1 = 200 bytes
    Average Row Length of t2 = 100 bytes
    Average Row Length of t3 = 500 bytes
    No of rows in t1 = 100
    No of rows in t2 = 1000
    No of rows in t3 = 500
    What is required is the 'query response time' for the said query.

    I do not know how to do it myself. But if you are running Oracle 10g, I believe that there is a new tool called: SQL Tuning Advisor which might be able to help.
    Here are some links I found doing a google search, and it looks like it might meet your needs and even give you more information on how to improve your code.
    http://www.databasejournal.com/features/oracle/article.php/3492521
    http://www.databasejournal.com/features/oracle/article.php/3387011
    http://www.oracle.com/technology/obe/obe10gdb/manage/perflab/perflab.htm
    http://www.oracle.com/technology/pub/articles/10gdba/week18_10gdba.html
    http://www.oracle-base.com/articles/10g/AutomaticSQLTuning10g.php
    Have fun reading:
    You can get help from teachers, but you are going to have to learn a lot by yourself, sitting alone in a room ....Dr. Seuss
    Regards
    Tim

  • How to know the runtime execution process

    Hi ,
    How to view the runtime execution process(steps) of a class. I know how to debug, but i like to view the Assembly language code .
    Please suggest
    Thanks ,
    Raj

    Why on earth are you ignoring your previous topic about the same question where the answer is already given more than once?
    [http://forums.sun.com/thread.jspa?threadID=5355140]

  • How to know the number of times end users search on iStore

    How can we know the number of times end users search on iStore

    I am not sure how can you do that with Oracle but I am doing that with Google Analytics (Site Search Settings).
    Thanks
    Shazi
    Edited by: 903823 on Nov 30, 2012 7:59 AM
    Edited by: 903823 on Nov 30, 2012 7:59 AM

  • How to know the correct Elapsed Time?

    When I run a query twice, I get better timing on the query the second time around. I am assuming this is happening becuase some or most of the data is still in cache.
    How do I remove the cache data so that I know if my Indexing or anything else really did effect the query?
    Thanks.

    If you want to flush every thin out you must flush the shared pool.
    "alter system flush shared_pool"Keep in mind that the shared pool contains the library cache, which is responsible for collecting, parsing, interpreting and executing all the sql statements that go against the oracle data base.
    This is a huge performance killer so i must advice you to try this on a development environment.
    Regards,
    Max.

  • How to know child procedure Execution time with in parent procedure

    Hi Team,
    I've a requirement in which I need to get the execution time of a child procedure while its running in a parent procedure in PLSQL. While the child process is running, I want to know its execution time so that if it execution time exceeds more than 5 seconds than I want to through an error. Please let me know by what means this can be achieved in plsql.
    Regards,
    Tech D.

    TechD wrote:
    Hi Team,
    I've a requirement in which I need to get the execution time of a child procedure while its running in a parent procedure in PLSQL. While the child process is running, I want to know its execution time so that if it execution time exceeds more than 5 seconds than I want to through an error. Please let me know by what means this can be achieved in plsql.
    Regards,
    Tech D.PL/SQL is NOT a Real Time programming language.
    The procedure that invokes the child procedure is effectively dormant while the child runs.
    Plus there is no easy way to know when 5 seconds has elapsed.

  • How to decide the calc execution time

    hi , even if we optimize a calc script and its efficent enough , still is there any way to calculate how much time will a calc script take to execute , i mean it depends the no. of blocks and may be cells i guess but if we know the number of blocks that are involved can we now decide how much time will it take to fix them.

    Hi Sharad,
    You have to understand the calculation process does not depend only the existing blocks.
    It involves calculations of dense member values within blocks, then it may create new blocks for sparse combinations. All these are dependent on the number of input measures and volume of data as well. These are factors with Essbase alone.
    But there could be other factors as well, like amount of memory your process gets allotted, system performance, etc.
    I'm not sure if it's so easy to track the calculation time, but refer the below link from dbag
    http://download.oracle.com/docs/cd/E12825_01/epm.111/esb_dbag/dcaoptcs.htm#dcaoptcs71227

  • How to reduce this query execution time !

    Just use your original cursor as an inline view, like so:
    CREATE OR REPLACE PROCEDURE SP_TEST_audit_history2
    (p_start IN date,
    p_end IN date,
    p_msgcode IN varchar2,
    p_partnername IN varchar2,
    p_status IN varchar2,
    p_locationname IN varchar2,
    p_custbusunit IN varchar2,
    p_sysaudithistory_cur OUT plutotypes.ref_cursor,
    p_status1 OUT NUMBER)
    AS
    BEGIN
    OPEN p_sysaudithistory_cur
    FOR
    SELECT tfm.hubmsgid,
    tfm.status || '-'|| nvl2 (tfm.exception_id, 'FAILED', 'OK'),
    tfm.datetime,
    tfm.exception_id
    FROM tfm_status tfm,
    (SELECT DISTINCT MAX (tfm.datetime) datetime, tfm.hubmsgid
    FROM tfm_status tfm, vw_msgcode_part_locn vw
    WHERE tfm.datetime >= NVL (p_start, TO_DATE ('01/01/1981', 'DD/MM/YYYY'))
    AND tfm.datetime <= NVL (p_end, TO_DATE ('31/12/9999','DD/MM/YYYY'))
    AND tfm.msgcode LIKE NVL (p_msgcode, '%')
    AND vw.msgcode = tfm.msgcode
    AND vw.partnername LIKE NVL (p_partnername, '%')
    AND tfm.status LIKE NVL (p_status, '%')
    AND vw.locationname LIKE NVL (p_locationname, '%')
    AND vw.custbusunit LIKE NVL (p_custbusunit, '%')
    AND rownum < 250
    GROUP BY tfm.hubmsgid) c_hubmsgids
    WHERE tfm.hubmsgid = c_hubmsgids.hubmsgid /* here only i am getting error*/
    AND tfm.datetime = c_hubmsgids.datetime
    AND tfm.status like NVL (p_status, '%');
    p_status1 := 0;
    EXCEPTION
    WHEN NO_DATA_FOUND THEN p_status1 := 1;
    END SP_TEST_audit_history2;
    If i run this query it is taking 18 seconds to retrive the records becoz of that group by clause..
    Can any body suggest any changed in code ( any hints) to make it faster that is execution time will be less than 10 seconds
    Thanx in advance
    prasanth a.s.

    Try removing the word distinct and see if that helps. Distinct should not be needed since the max and group by will result in distinct values.

  • How Can I reduce Query Execution time with use of filter

    Dear Experts,
    In a query execution is faster when there is no product filter and these products can be a list contaning mare than 300 items.
    I am using In operator for that filter.

    Maybe if you posted the quer[y][ies] we could get a better idea.

Maybe you are looking for

  • Report for Req Material and Issue Material for Project/WBS

    Dear All, My client need a report for a WBS element-wise material required and material issue with value. Let me know if any standard report avialble for same?? Or Incase of devlopment which are the tables we can use to Get req qty and issue qty of m

  • Stuck on grey screen with apple logo when starting up?

    Hi, My Macbook (2009 aluminium unibody (Leopard 10.5.8)) won't boot. When I try to start it up it gives the chime and then gets stuck at the grey screen with the Apple logo and some spinning gear below. I have tried booting with the install DVD and r

  • Access share on NSS4000 with error: A device attached to the system is not functioning

    Hello, We use Acronis True Image Server to backup 4 Windows 2008 Standard Server system with 2 different domains, each containing a DC and a RDP-Server. After Server reboot, backup will run only once a day. The next day backup aborts, and while tryin

  • How can i use external hard drive with mac and pc!

    I've been using a Lacie external hard drive with my mac to keep the itunes library and other things since day one. Since i have a dvd with files for windows and an old pc without a dvd drive, i decided to copy and paste the content of the dvd to the

  • How to create dynamic tree component

    I am using netbeans 5.5 and visual web pack to develop my jsf application. I want to add a tree component that will be tied to a table with following columns: id,parent_id,name Actually the table stores data in tree structure with parent_id storing t