Identifying query execution time

Hello,
I would like to know how can I figure out the actual query execution time in Oracle.
Regards

Oracle Documentation is your best friend.
http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/dynviews_2113.htm#i1417057
ELAPSED_TIME --> Elapsed time (in microseconds) used by this cursor for parsing, executing, and fetching
Asif Momen
http://momendba.blogspot.com

Similar Messages

  • 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.

  • Clustering of SQL query execution times

    In doing some query execution experiments I have noted a curious (to me, anyhow) clustering of execution times around two distinct points. Across about 100 tests each running 1000 queries using (pseudo-)randomly generated IDs the following pattern emerges. The queries were run from Java using all combinations of pooled/non-pooled and thin/oci driver combinations:
         100          *
         90          *
    R     80          *
    u     70          *
    n     60          *
    s     50          *
         40          *                                             *
         30          *                                             *
         20          *                                        *     *     *
         10          *     *                              *     *     *     *     
              0     100     200     300     400     500     600     700     800     900     1000     1100     1200
                                       Time(ms)Where about half of the total execution times cluster strongly about a given (short) time value with a smaller but broader clustering at a significantly slower mark, with zero intermediate values. The last point is the one I find most curious.
    What I would have expected is something like this:
         100          
         90          
    R     80          
    u     70          
    n     60          
    s     50          
         40                              *                         
         30                         *     *     *                    
         20                    *     *     *     *     *     *          
         10          *     *     *     *     *     *     *     *     *     *          
              0     100     200     300     400     500     600     700     800     900     1000     1100     1200
                                       Time(ms)The variables I have tentatively discounted thus far:
    -query differences (single query used)
    -connection differences (using single pooled connection)
    -garbage collection (collection spikes independent of query execution times)
    -amount of data returned in bytes (single varchar2 returned and size is independent of execution time)
    -driver differences (thin and oci compared, overall times differ but pattern of clustering remains)
    -differences between Statement and PreparedStatement usage (both show same pattern)
    I know this is a rather open-ended question, but does the described pattern seem faniliar or spark any thoughts?
    DB-side file I/O?
    Thread time-slicing variations (client or DB-side)?
    FWIW, the DB is 9.2.0.3 DB and the clients are running on WinXP with Java 5.0 and 9i drivers.
    Thanks and regards,
    M

    Further context:
    Are your queries only SELECT queries ?
    Yes, the same SELECT query is used for all tests. The only variable is the bind variable used to identify the primary key of the selection set (i.e. SELECT a.* from a, b, c where a.x = b.x and b.y = c.y and c.pk = ?) where all PKs and FKs are indexed.Do the queries always use the same tables, the same where clauses ?
    Yes, the same tables are always invoked. The where clauses invoked are identical with the excepton of the single bind variable as described above.Do your queries always use bind variables ?
    A single bind variable is used in all invocations as described above.Are your queries also running in single user mode or multi user mode (do you use SELECT FOR UPDATE ?) ?
    We are not using SELECT FOR UPDATEDid something else run on the database/on the server hosting the database on the same time ?
    I have not eliminated the idea, but the test has been repeated roughly 100 times over the course of a week and at different times of day with the same pattern emerging. I suppose it is not out of the question that a resource-hogging process is running consistently and constantly on the DB-side box.Thanks for the input,
    M

  • Reducing query execution time

    how can we reduce query execution time?which methods we have to follow to optimization?

    which methods we have to follow to optimization?First, read this informative thread:
    How to post a SQL statement tuning request HOW TO: Post a SQL statement tuning request - template posting
    and post the relevant details we need.
    Execution plans and/or TRACE/TKPROF output can help you identifying performance bottlenecks.

  • Query execution time

    Dear SCN,
    I am new to BOBJ Environment. I have created a webi report on top of bex query by using BISC connection. Bex query is build for Vendor Ageing Analysis. My bex query will take very less time to execute the report (max 1 min). But in case of webi is takeing around 5 min when i click on refresh. I have not used any conditions,filters,restrictions are done at webi level all are done at bex level only.
    Please let me know techniques to optimize the query execution time in webi. Currently we are in BO 4.0.
    Regards,
    PRK

    Hi Praveen
    Go through this document for performance optimization using BICS connection
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/d0e3c552-e419-3010-1298-b32e6210b58d?QuickLink=index&…

  • Slow query execution time

    Hi,
    I have a query which fetches around 100 records from a table which has approximately 30 million records. Unfortunately, I have to use the same table and can't go ahead with a new table.
    The query executes within a second from RapidSQL. The problem I'm facing is it takes more than 10 minutes when I run it through the Java application. It doesn't throw any exceptions, it executes properly.
    The query:
    SELECT aaa, bbb, SUM(ccc), SUM(ddd), etc
    FROM MyTable
    WHERE SomeDate= date_entered_by_user  AND SomeString IN ("aaa","bbb")
    GROUP BY aaa,bbbI have an existing clustered index on SomeDate and SomeString fields.
    To check I replaced the where clause with
    WHERE SomeDate= date_entered_by_user  AND SomeString = "aaa"No improvements.
    What could be the problem?
    Thank you,
    Lobo

    It's hard for me to see how a stored proc will address this problem. I don't think it changes anything. Can you explain? The problem is slow query execution time. One way to speed up the execution time inside the RDBMS is to streamline the internal operations inside the interpreter.
    When the engine receives a command to execute a SQL statement, it does a few things before actually executing the statement. These things take time. First, it checks to make sure there are no syntax errors in the SQL statement. Second, it checks to make sure all of the tables, columns and relationships "are in order." Third, it formulates an execution plan. This last step takes the most time out of the three. But, they all take time. The speed of these processes may vary from product to product.
    When you create a stored procedure in a RDBMS, the processes above occur when you create the procedure. Most importantly, once an execution plan is created it is stored and reused whenever the stored procedure is ran. So, whenever an application calls the stored procedure, the execution plan has already been created. The engine does not have to anaylze the SELECT|INSERT|UPDATE|DELETE statements and create the plan (over and over again).
    The stored execution plan will enable the engine to execute the query faster.
    />

  • Query execution time estimation....

    Hi All,
    Is it possible to estimate query execution time using explain plan?
    Thanks in advance,
    Santosh.

    The cost estimated by the cost based optimizer is actually representing the time it takes to process the statement expressed in units of the single block read-time. Which means if you know the estimated time a single block read request requires you can translate this into an actual time.
    Starting with Oracle 9i this information (the time to perform single block/multi block read requests) is actually available if you gather system statistics.
    And this is what 10g actually does, as it shows an estimated TIME in the explain plan output based on these assumptions. Note that 10g by default uses system statistics, even if they are not explicitly gathered. In this case Oracle 10g uses the NOWORKLOAD statistics generated on the fly at instance startup.
    Of course the time estimates shown by Oracle 10g may not even be close to the actual execution time as it is only an estimate based on a model and input values (statistics) and therefore might be way off due to several reasons, the same applies in principle to the cost shown.
    Regards,
    Randolf
    Oracle related stuff:
    http://oracle-randolf.blogspot.com/
    SQLTools++ for Oracle:
    http://www.sqltools-plusplus.org:7676/
    http://sourceforge.net/projects/sqlt-pp/

  • Table defination in datatype size can effect on query execution time.

    Hello Oracle Guru,
    I have one question , suppose I have create one table with more than 100 column
    and i tacke every column datatype varchar2(4000).
    Actual data are in every column not more than 300 character so in this case
    if i execute only select query
    so oracle cursor internaly read up to 4000 character one by one
    or it read character one by one and in last character ex. 300 it will stop there.
    If i reduce varchar2 size 300 instend of 4000 in table defination,
    so is it effect on select query execution time ?
    Thanks in advance.

    When you declare VARCHAR2 column you specify maximum size that can be stored in that column. Database stores actual number of bytes (plus 2 bytes for length). So if yiou insert 300 character string, only 302 bytes will be used (assuming database character set is single byte character set).
    SY.

  • How to know query execution time in sql plus

    HI
    I want to know the query execution time in sql plus along with statistics
    I say set time on ;
    set autotrace on ;
    select * from view where usr_id='abcd';
    if the result is 300 rows it scrolls till all the rows are retrieved and finally gives me execution time as 40 seconds or 1 minute.. (this is after all the records are scrolled )
    but when i execute it in toad it gives 350 milli seconds..
    i want to see the execution time in sql how to do this
    database server 11g and client is 10g
    regards
    raj

    what is the difference between .. the
    statistics gathered in sql plus something like this and the one that i get from plan_table in toad?
    how to format the execution plan I got in sqlplus in a proper understanding way?
    statistics in sqlplus
    tatistics
             0  recursive calls
             0  db block gets
           164  consistent gets
             0  physical reads
             0  redo size
         29805  bytes sent via SQL*Net to client
           838  bytes received via SQL*Net from client
            25  SQL*Net roundtrips to/from client
             1  sorts (memory)
             0  sorts (disk)
           352  rows processedexecution plan in sqlplus... how to format this
    xecution Plan
      0      SELECT STATEMENT Optimizer=ALL_ROWS (Cost=21 Card=1 Bytes=10
             03)
      1    0   HASH (UNIQUE) (Cost=21 Card=1 Bytes=1003)
      2    1     MERGE JOIN (CARTESIAN) (Cost=20 Card=1 Bytes=1003)
      3    2       NESTED LOOPS
      4    3         NESTED LOOPS (Cost=18 Card=1 Bytes=976)
      5    4           NESTED LOOPS (Cost=17 Card=1 Bytes=797)
      6    5             NESTED LOOPS (OUTER) (Cost=16 Card=1 Bytes=685)
      7    6               NESTED LOOPS (OUTER) (Cost=15 Card=1 Bytes=556
      8    7                 NESTED LOOPS (Cost=14 Card=1 Bytes=427)
      9    8                   NESTED LOOPS (Cost=5 Card=1 Bytes=284)
    10    9                     TABLE ACCESS (BY INDEX ROWID) OF 'USR_XR
             EF' (TABLE) (Cost=4 Card=1 Bytes=67)
    11   10                       INDEX (RANGE SCAN) OF 'USR_XREF_PK' (I
             NDEX (UNIQUE)) (Cost=2 Card=1)
    12    9                     TABLE ACCESS (BY INDEX ROWID) OF 'USR_DI
             M' (TABLE) (Cost=1 Card=1 Bytes=217)
    13   12                       INDEX (UNIQUE SCAN) OF 'USR_DIM_PK' (I
             NDEX (UNIQUE)) (Cost=0 Card=1)
    14    8                   TABLE ACCESS (BY INDEX ROWID) OF 'HDS_FCT'
              (TABLE) (Cost=9 Card=1 Bytes=143)
    15   14                     INDEX (RANGE SCAN) OF 'HDS_FCT_IX2' (IND
             EX) (Cost=1 Card=338)
    16    7                 TABLE ACCESS (BY INDEX ROWID) OF 'USR_MEDIA_
             COMM' (TABLE) (Cost=1 Card=1 Bytes=129)
    17   16                   INDEX (UNIQUE SCAN) OF 'USR_MEDIA_COMM_PK'
              (INDEX (UNIQUE)) (Cost=0 Card=1)
    18    6               TABLE ACCESS (BY INDEX ROWID) OF 'USR_MEDIA_CO
             MM' (TABLE) (Cost=1 Card=1 Bytes=129)
    19   18                 INDEX (UNIQUE SCAN) OF 'USR_MEDIA_COMM_PK' (
             INDEX (UNIQUE)) (Cost=0 Card=1)
    20    5             TABLE ACCESS (BY INDEX ROWID) OF 'PROD_DIM' (TAB
             LE) (Cost=1 Card=1 Bytes=112)
    21   20               INDEX (UNIQUE SCAN) OF 'PROD_DIM_PK' (INDEX (U
             NIQUE)) (Cost=0 Card=1)
    22    4           INDEX (UNIQUE SCAN) OF 'CUST_DIM_PK' (INDEX (UNIQU
             E)) (Cost=0 Card=1)
    23    3         TABLE ACCESS (BY INDEX ROWID) OF 'CUST_DIM' (TABLE)
             (Cost=1 Card=1 Bytes=179)
    24    2       BUFFER (SORT) (Cost=19 Card=22 Bytes=594)
    25   24         INDEX (FAST FULL SCAN) OF 'PROD_DIM_AK1' (INDEX (UNI
             QUE)) (Cost=2 Card=22 Bytes=594)

  • How can I reduce BEx Query execution time

    Hi,
    I have a question regarding query execution time in BEx.
    I have a query that takes 45 mins to 1 hour to execute in BEx analyser. This query is run on a daily basis and hence I am keen to reduce the execution time.  Are there any programs or function modules that can help in reducing query execution time?
    Thanks and Regards!

    Hi Sriprakash,
    1.Check if your cube is performance tuned: in the manage cube from RSA1 / performance tab: check if all indexes and statistics are green. Aggregate IDx should as well be.
    2.Condense your cubes regularly
    3. Evaluate the creation of an aggregate with all characteristic used in the query (RSDDV).
    4.Evaluate the creation of a "change run aggregate": based on a standalone NavAttr (without its basic char in the aggr.) but pay attention to the consequent change run when loading master data.
    5. Partition (physically) your cubes systematically when possible (RSDCUBE, menu, partitioning)
    6. Consider logical partitioning (by year or comp_code or ...) and make use of multiproviders in order to keep targets not too big...
    7.Consider creating secondary indexes when reporting on ODS (RSDODS)
    8.Check if the query runtime is due the master data read or the infoprovider itself, or the OLAP processor and/or any other cause in tx ST03N
    9.Consider improving your master reads by creating customized IDX (BITMAP if possible and depending on your data) on master data table and/or attribute SIDs when using NAvs.
    10.Check that your basis team did a good job and have applied the proper DB parameters
    11.Last but not least: fine tune your datamodel precisely.
    hope this will give you an idea.
    Cheers
    Sunil

  • Function used to find Query Execution Time

    Hi All!
    Could you please let me know the function name used in finding 'Query Execution Time'?
    Thanks and Regards,
    Vikas

    I'm not quite sure what you mean...
    In SQL*Plus: SET TIMING ON
    This will display a timing message after the execution of a query. Is this what you mean?
    cheers,
    Anthony

  • How to get query execution time without running...?

    Hi ,
    I had one requirement .... as follows ......
    i had 3 sql statements . I need to execute only one sql which execution time is very less.
    Can any one help me , how to get query execution time without running that query and without using explain plan..?
    Thanks,
    Rajesh

    Kim Berg Hansen wrote:
    But you have ruled out explain plan for some reason, so I cannot help you.OP might get some answers if query was executed before - but since restart. Check V$SQL dynamic performance view for SQL_TEXT = your query. Then ROUND(ELAPSED_TIME / EXECUTIONS / 1000000) will give you average elapsed time.
    SY.
    Edited by: Solomon Yakobson on Apr 3, 2012 8:44 AM

  • SEM_MATCH query execution time when a predicate is set as a variable

    Hello there,
    Our ontology contains 70 million triples (12.5 million asserted triples and 58 million inferred triples). We created a virtual model which includes both asserted and inferred triples).
    Our semantic network index configuration is 'PSCM' (index status is valid).
    The problem we encounter is when we run a SEM_MATCH query which includes a predicate as a variable, the query ran for 22 seconds. When a similar query is run when the variable is subject or an object or both the time for the SEM_MATCH query execution is 0.2 seconds. Is this reasonable? What do we do wrong?
    For example:
    1. Predicate as a variable (execution time is 22 seconds):
    SELECT a FROM TABLE ( SEM_MATCH
    ( ' { <http://www.tomproj.com/rep#entity_4> ?a 4 }',
    SEM_MODELS( 'TOM_VIRTUAL_MODEL') ,
    NULL,
    NULL,
    NULL,
    'ALLOW_DUP=T'));
    2. Subject as a variable (execution time is 0.2 seconds):
    SELECT a FROM TABLE ( SEM_MATCH
    ( ' { ?a <http://www.tomproj.com/rep#id> 4  }',
    SEM_MODELS( 'TOM_VIRTUAL_MODEL') ,
    NULL,
    NULL,
    NULL,
    'ALLOW_DUP=T'));
    2. Object as a variable (execution time is 0.2 seconds):
    SELECT a FROM TABLE ( SEM_MATCH
    ( ' { <http://www.tomproj.com/rep/#entity_4> <http://www.tomproj.com/rep#id> a }',
    SEM_MODELS( 'TOM_VIRTUAL_MODEL') ,
    NULL,
    NULL,
    NULL,
    'ALLOW_DUP=T'));
    Cheers,
    Doron

    Hi,
    So far no lack, None of the solutions are working.
    Query execution time didn't change after executing the following:
    1. SEM_APIS.DROP_SEM_INDEX('SCP');
    2. SEM_APIS.ADD_SEM_INDEX('SCPM');
    3. SEM_APIS.ALTER_SEM_INDEX_ON_MODEL('TOM','SCPM','REBUILD');
    4. SEM_APIS.ALTER_SEM_INDEX_ON_MODEL('TOM_TF','SCPM','REBUILD');
    5. SEM_APIS.ALTER_SEM_INDEX_ON_RULES_INDEX('TOM_RI','SCPM','REBUILD');
    My original query (see below) execution time remains 22 secs.
    SELECT a FROM TABLE ( SEM_MATCH
    ( ' { <http://www.tomproj.com/rep#entity_4> ?a 4 }',
    SEM_MODELS( 'TOM_VIRTUAL_MODEL') ,
    NULL,
    NULL,
    NULL,
    'ALLOW_DUP=T'));
    When running the SEM_MATCH on each model ('TOM,'TOM_TF') separately execution time was very fast (~0.007 secs):
    1. SELECT a FROM TABLE ( SEM_MATCH
    ( ' { <http://www.tomproj.com/rep#entity_4> ?a 4 }',
    SEM_MODELS( 'TOM') ,
    NULL,
    NULL,
    NULL,
    NULL));
    2. . SELECT a FROM TABLE ( SEM_MATCH
    ( ' { <http://www.tomproj.com/rep#entity_4> ?a 4 }',
    SEM_MODELS( 'TOM_TF') ,
    NULL,
    NULL,
    NULL,
    NULL));
    When running the query on both models, execution time was 54 secs:
    SELECT a FROM TABLE ( SEM_MATCH
    ( ' { <http://www.tomproj.com/rep#entity_4> ?a 4 }',
    SEM_MODELS( 'TOM','TOM_TF') ,
    NULL,
    NULL,
    NULL,
    NULL));
    We also run the original query via the Jena Adaptor using Java language and SPARQL, but the results were similar.
    As for using parallel parameter in SEM_APIS.ALTER_SEM_INDEX…, since we are using Oracle 11g release 1 the SEM_APIS.ALTER_SEM_INDEX doesn’t support the parallel parameter as far as we know.
    In Oracle 11g release 2 the SEM_APIS.ALTER_SEM_INDEX was extended to support the use of 'parallel' parameter.
    Any ideas on what do we do wrong?
    Cheers,
    Doron

  • 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.

  • Query runtime vs Query execution time

    Hi,
    I am trying to find the most executed queries (how often queries are executed) in our BI system.
    I got query runtime from Hitlist in st03 Reporting analysis.
    could someone tell me if its same as query execution time or where can I check most executed queries or how often are queries executed.
    thanks

    hi,
    I hope you already installed the statistics.
    You can get lot of details like  which quereis are being used and their history and how many times they executed and by whom , when  and also tells  DB, OLPA, and Frontend times in ST03N in Expert mode
    refer below thread
    Re: BEx Query is executed how many times???
    also refer help - navigate to  BW Statistics MultiProvider Queries
    http://help.sap.com/saphelp_nw04s/helpdata/en/44/10cb9a8f345cf9e10000000a155369/frameset.htm
    hope it helps u
    Thanks
    Edited by: Srinivas on Oct 30, 2008 9:42 PM

Maybe you are looking for

  • Quicktime movie does not work on hosted iWeb website

    Problem: I have a media file portion on my iWeb designed website that displays pictures (working very well) and one that is supposed to show a movie (not working at all). The movie was made with iMovie and has an .m4v extension. When you click on the

  • New to RDS - What do I need to set up for 3 users on 2008R2?

    I need to set up an existing 2008R2 server with the RDS role so that 3 users can remote into the server and use Office applications. I've been on the phone with MSFT for 45 minutes and I think I get it, but I wanted to get a second opinion, and possi

  • Can't delete or find non existing files in Errors tab and in/out palette

    I have two files (findlaw.html and cyrites.html) that no longer are in use that I want to trash. When I trash either of the files, I  get 5 Missing Files in the Error Tab that are supposedly linked to these two files I want to trash. I've gone throug

  • Conversion from milliseconds to Date in 1.5

    A java.util.Date object can be constructed by passing the number of milliseconds since 1 January 1970 as a constructor argument. This Date can then be formatted to a human-readable format with SimpleDateFormat. I have tested this conversion from mill

  • How to recover the selection tool?

    Acrobat XI.  The selection tool (arrow only - not the one that's an arrow with a text-insert cursor next to it) disappeared from the ribbon on my Acrobat.  How do I get it back?