Couldnt find query elapsed time  version 2.1.1.64

Hi All,
I have oracle sql devloper 2.1.1.64. can you please help me how to find the query elapsed time in this? i tried the help option but couldnt figure out correctly. not cant we see the query elapsed time in sql devloper at all ?

Then you can:
1) temporarily modify the
Tools -> Preferences -> Database -> Advanced -> Sql Array Fetch Sizeparameter to fetch all the records you need.
2) simply hit Ctrl-Pag down to fetch all the remaining records
3) run as script (using F5).

Similar Messages

  • 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 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 findout the sql query elapsed time for last call

    RDBMS vesrion: 11.2.0.3
    How can I get the stats like how much time it took for a query to run if I know the "sql_id"
    I can query v$sql and find out the "parse_calls","fetches","execution","elapsed_time" (microsecs)
    but if the query executed 20 times then the elapsed time will be the cumulative of all the executions.
    But I want to know the ELAPSED TIME of LAST CALL(last execution only) for that sql_id.
    Edited by: rcc50886 on Aug 2, 2012 8:35 AM

    You can easily monitor the statement and see the results for v$sql_monitorWe didn't enabled the monitor for the sql's and its not possible in my current enveronment due to some issues with management.
    Is there any way to find out the last elapsed time for the sql with known sql_id ?

  • Query elapsed time

    Hi,
    Oracle version: 8.1.7.4
    I run DBMS_STATS.GATHER_SCHEMA_STATS (OwnName => 'TOM') and now I need the elapsed time between a table and another.
    for example in dba_tables I have:
    TABLE_NAME          LAST_ANALYZED
    TAB1               2012/10/01 18:00:00
    TAB2               2012/10/01 19:00:00
    TAB3               2012/10/01 19:30:00
    TAB4               2012/10/01 19:40:20
    ...........................................I'd like to get this output: TABLE_NAME_FIRST     TABLE_NAME_SECOND               ELAPSED_TIME
    TAB1                    TAB2                         1 h
    TAB2                    TAB3                         30 min     
    TAB3                    TAB4                         10 min - 20 sec.               Have anyone how can i write this query?
    Thanks in advance!

    Oracle version: 8.1.7.4You're in luck, the analytic function you need is available in your version :
    SQL> select table_name as table1
      2       , lead(table_name) over(order by last_analyzed) as table2
      3       , numtodsinterval(
      4           lead(last_analyzed) over(order by last_analyzed)
      5           - last_analyzed
      6         , 'DAY'
      7         ) as elapsed
      8  from user_tables
      9  where table_name not like 'SYS%'
    10  ;
    TABLE1                         TABLE2                         ELAPSED
    TEST_DATA                      XML_DOCUMENT_TABLE             +000000001 00:00:03.000000000
    XML_DOCUMENT_TABLE             PKT_MASTER                     +000000005 23:59:56.000000000
    PKT_MASTER                     TEST2                          +000000000 00:00:00.000000000
    TEST2                          EVAL_IDX_TAB                   +000000000 11:28:04.000000000
    EVAL_IDX_TAB                   STRUCTURED_INDEX_TEST          +000000000 12:32:02.000000000
    STRUCTURED_INDEX_TEST          PATHS                          +000000000 00:00:00.000000000
    PATHS                          XML_T2_PATH_TABLE              +000000000 11:50:17.000000000
    [...]

  • How to find query completion time

    How to find active insert query completion time in oracle?

    friend,
    i don't find anything in the query since time_remaing value show zero.
    select TIME_REMAINING,TOTALWORK,START_TIME,SOFAR from v$session_longops where sid=115.
    TIME_REMAINING TOTALWORK START_TIM SOFAR
    0 21456 11-MAY-09 21456
    0 4588 11-MAY-09 4588
    0 6138 11-MAY-09 6138
    could you please guide me how to calcaluate the completion time?

  • How to find query processing time?

    im using Oracle Express Edition
    i want to find the processing time of a query?,
    anyone please specify briefly how to find the query processing time
    can i get the processing time of a query by using Express edition or should i install Enterprise Edition.
    with regards,
    ravikanth.

    This link will help
    http://forums.oracle.com/forums/thread.jspa?threadID=2210335&tstart=0

  • To find Query Run-times

    Hi guys,
    i was trying to compare query run-times with and without BIA using RSRT, however i'm running into hurdles..
    the same query when executed twice (without BIA) without using cache is showing different data manager times
    i'm surprised how the reason could be
    the difference sometimes is very high even the wait times are also sometimes very different
    how to arrive at the average run-times are there any tools besides rsrt (i hve no access to statistics queries) but st03 doesnt seem to be of much help
    i'm lookin at the fine difference so accurate times are necessary
    thanks,
    your help will be greatly appreciated

    Hi.....
    check the following links :
    http://help.sap.com/saphelp_nw04s/helpdata/en/43/e3807a6df402d3e10000000a1553f7/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/7c/2bde42fa712b78e10000000a155106/frameset.htm
    Another thing :
    If you want to use the BI statistics for Query runtimes, you will need the 0TCT_C01 InfoCube, together with the multiprovider 0TCT_MC01.
    The queries for the BI statistics to report over query runtimes are all built on the multiprovider.
    Besides that, you will need the virtual infoprovider 0TCT_VC01, to be able to report on the latest data. Because you will probably load the statistics each night into the 0TCT_C01 cube, you can report on the latest data using the 0TCT_VC01 virtual cube.
    Hope this helps you........
    Regards,
    Debjani.........
    Edited by: Debjani  Mukherjee on Sep 13, 2008 8:01 AM

  • ORA-1555  ORA-3136 errors:: elapsed time vs Query Duration

    Dear all,
    - My Database version is 11.2.0.2, Solaris.
    - We have been having a problem in the production database where the front end nodes start going up and down for couple of hours sometimes. ; When node flapping is going on we get connection timed out alerts.
    WARNING: inbound connection timed out (ORA-3136) opiodr aborting
    process unknown ospid (4342) as a result of ORA-609 opiodr aborting
    process unknown ospid (4532) as a result of ORA-609 opiodr aborting
    process unknown ospid (4534) as a result of ORA-609 opiodr aborting....
    Since this week node flapping is happening every day. Since past 2 days after or during node flapping we are getting ORA-1555 error.
    Extract from alert log error:
    ORA-01555 caused by SQL statement below (SQL ID: g8804k5pkmtyt, Query Duration=19443 sec, SCN: 0x0001.07bd90ed):
    SELECT d.devId, d.vendor, d.model, d.productClass, d.oui, d.parentDeviceId, d.created, d.lastModified AS devLastMod, d.customerId, d.userKey1, d.userKey2, d.userKey4, d
    .userKey5, d.firmwareFamily, d.softwareVer, d.serialNum, d.ip, d.mac, d.userKey3, d.userKey6, d.provisioningId, d.status, d.classification, d.population, d.name, d.ipRe
    solver, d.ipExpirationTime, d.geoLocationId,contact.firstContactTime, ifaces.id, ifaces.type AS ifaceType, ifaces.lastModified AS ifaceLastMod, ifaces.timeoutname, ifac
    es.username1, ifaces.password1, ifaces.username2, ifaces.password2, ifaces.connReqUrl, ifaces.connReqScheme, ifaces.srvNonce, ifaces.deviceNonce, ifaces.phoneNumber,ifa
    ces.bootstrapSecMethod, ifaces.srvAuthentication, ifaces.deviceAuthentication, ifaces.userPIN, ifaces.networkID, ifaces.omaSessionID, ifaces.portNum, ifaces.mgtIp, ifac
    es.cmtsIp, ifaces.mgtReadCommunity, ifaces.mgtWriteCommunity, ifaces.cmtsReadCommunity, ifaces.cmtsWriteCommunity, devto.name AS devtoName, devto.rebootTimeout, devto.sessionInitiationI run Statspack report from the whole day duration, and looking into the elapsed time in seconds no more than 3739.61 sec (too lower than run duration in the alert log file of 19443 sec); So I would like to know if there is any co-relations between the ORA-3136 errors and the ORA-1555 errors?
       CPU                  CPU per             Elapsd                     Old
      Time (s)   Executions  Exec (s)  %Total   Time (s)    Buffer Gets  Hash Value
    tTime <= :3 ) AND (endTime IS NULL OR endTime >= :4 )
       2773.77    7,787,914       0.00    3.4    3739.61     112,671,645 1909376826
    Module: JDBC Thin Client
    SELECT d.devId, d.vendor, d.model, d.productClass, d.oui, d.pare
    ntDeviceId, d.created, d.lastModified AS devLastMod, d.customerI
    d, d.userKey1, d.userKey2, d.userKey4, d.userKey5, d.firmwareFam
    ily, d.softwareVer, d.serialNum, d.ip, d.mac, d.userKey3, d.user
    SQL> show parameter UNDO_MANAGEMENT
    NAME                                 TYPE        VALUE
    undo_management                      string      AUTO
    SQL> show parameter UNDO_RETENTION
    NAME                                 TYPE        VALUE
    undo_retention                       integer     10800BR,
    Diego

    Thank you. Please let me know if it is enough or you need more information;
    SQL ordered by Gets  DB/Inst: DB01/db01  Snaps: 14835-14846
    -> End Buffer Gets Threshold:    100000 Total Buffer Gets:     677,689,568
    -> Captured SQL accounts for   73.6% of Total Buffer Gets
    -> SQL reported below exceeded  1.0% of Total Buffer Gets
                                                         CPU      Elapsd     Old
      Buffer Gets    Executions  Gets per Exec  %Total Time (s)  Time (s) Hash Value
         21,286,248    2,632,793            8.1    3.4   666.73    666.76 3610154549
    Module: JDBC Thin Client
    SELECT d.devId, d.vendor, d.model, d.productClass, d.oui, d.pare
    ntDeviceId, d.created, d.lastModified AS devLastMod, d.customerI
    d, d.userKey1, d.userKey2, d.userKey4, d.userKey5, d.firmwareFam
    ily, d.softwareVer, d.serialNum, d.ip, d.mac, d.userKey3, d.user
         17,029,561    1,176,849           14.5    2.7   417.32    416.73 1909376826
    Module: JDBC Thin Client
    SELECT d.devId, d.vendor, d.model, d.productClass, d.oui, d.pare
    ntDeviceId, d.created, d.lastModified AS devLastMod, d.customerI
    d, d.userKey1, d.userKey2, d.userKey4, d.userKey5, d.firmwareFam
    ily, d.softwareVer, d.serialNum, d.ip, d.mac, d.userKey3, d.user
         17,006,795           37      459,643.1    2.7   367.61    368.95 4045552861
    Module: JDBC Thin Client
    SELECT d.devId, d.vendor, d.model, d.productClass, d.oui, d.pare
    ntDeviceId, d.created, d.lastModified AS devLastMod, d.customerI
    d, d.userKey1, d.userKey2, d.userKey4, d.userKey5, d.firmwareFam
    ily, d.softwareVer, d.serialNum, d.ip, d.mac, d.userKey3, d.userAnother Statspack report for the whole day shows;
    SQL ordered by CPU  DB/Inst: DB01/db01  Snaps: 14822-14847
    -> Total DB CPU (s):          82,134
    -> Captured SQL accounts for   40.9% of Total DB CPU
    -> SQL reported below exceeded  1.0% of Total DB CPU
        CPU                  CPU per             Elapsd                     Old
      Time (s)   Executions  Exec (s)  %Total   Time (s)    Buffer Gets  Hash Value
    tTime <= :3 ) AND (endTime IS NULL OR endTime >= :4 )
       2773.77    7,787,914       0.00    3.4    3739.61     112,671,645 1909376826
    Module: JDBC Thin Client
    SELECT d.devId, d.vendor, d.model, d.productClass, d.oui, d.pare
    ntDeviceId, d.created, d.lastModified AS devLastMod, d.customerI
    d, d.userKey1, d.userKey2, d.userKey4, d.userKey5, d.firmwareFam
    ily, d.softwareVer, d.serialNum, d.ip, d.mac, d.userKey3, d.user
    SQL ordered by Gets  DB/Inst: DB01/db01  Snaps: 14822-14847
    -> End Buffer Gets Threshold:    100000 Total Buffer Gets:   1,416,456,340
    -> Captured SQL accounts for   55.8% of Total Buffer Gets
    -> SQL reported below exceeded  1.0% of Total Buffer Gets
                                                         CPU      Elapsd     Old
      Buffer Gets    Executions  Gets per Exec  %Total Time (s)  Time (s) Hash Value
         86,354,963    7,834,326           11.0    6.3  2557.34   2604.08  906944860
    Module: JDBC Thin Client
    SELECT d.devId, d.vendor, d.model, d.productClass, d.oui, d.pare
    ntDeviceId, d.created, d.lastModified AS devLastMod, d.customerI
    d, d.userKey1, d.userKey2, d.userKey4, d.userKey5, d.firmwareFam
    ily, d.softwareVer, d.serialNum, d.ip, d.mac, d.userKey3, d.user
    .....BR,
    Diego
    Edited by: 899660 on 27-ene-2012 7:43
    Edited by: 899660 on 27-ene-2012 7:45

  • 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 can I get the elapse time for execution of a Query for a session

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

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

  • How to get elapsed time of the query in form 6i

    hi
    I used to use " set timing on " in sql to get the elapsed time
    set timing on
    elapsed time :XX:XX:XX ,
    but i dont know how to get it in fom
    its really imporant to measure the time elapsed for me cuz i am student an need to get the time
    thanx alot

    regarding to point 1 : u know there are three modes for system ; query, enter_qeury,and normal. when the system is not noraml so it is either query or enter_query , and both are query processing ( as i think) so it the elapsed time . it also by using timer stpos when system finish query ( normal)
    why you dont prefer timers ..... ( it important please to explain )
    thank you very much Navnit Punj
    Edited by: user8652693 on 22/07/2009 07:33 ص

  • Query Execution/Elapsed Time and Oracle Data Blocks

    Hi,
    I have created 3 tables with one column only. As an example Table 1 below:
    SQL> create table T1 ( x char(2000));
    So 3 tables are created in this way i.e. T1,T2 and T3.
    T1 = in the default database tablespace of 8k (11g v11.1.0.6.0 - Production) (O.S=Windows).
    T2 = I created in a Tablespace with Blocksize 16k.
    T3 = I created in a Tablespace with Blocksize 4k. In the same Instance.
    Each table has approx. 500 rows (So, table sizes are same in all the cases to test Query execution time ). As these 3 tables are created under different data block sizes so the ALLOCATED no. of data blocks are different in all cases.
    T1  =   8k  = 256 Blocks =  00:00:04.76 (query execution time/elapsed time)
    T2  = 16k=121 Blocks =  00:00:04.64
    T3 =   4k =  490 Blocks =  00:00:04.91
    Table Access is FULL i.e. I have used select * from table_name; in all 3 cases. No Index nothing.
    My Question is why query execution time is nearly the same in all 3 cases because Oracle has to read all the data blocks in each case to fetch the records and there is a much difference in the allocated no. of blocks ???
    In 4k block size example, Oracle has to read just 121 blocks and it's taking nearly the same time as it's taking to read 490 blocks???
    This is just 1 example of different data blocks. I have around 40 tables in each block size tablespace and the result are nearly the same. It's very strange for me because there is a much difference in the no. of allocated blocks but execution time is almost the same, only difference in milliseconds.
    I'll highly appreciate the expert opinions.
    Bundle of thanks in advance.
    Best Regards,

    Hi Chris,
    No I'm not using separate databases, it's 8k database with non-standard blocksizes of 16k and 4k.
    Actually I wanted to test the Elapsed time of these 3 tables, so for that I tried to create the same size
    tables.
    And how I equalize these is like I have created one column table with char(2000).
    555 MB is the figure I wanted to use for these 3 tables ( no special figure, just to make it bigger than the
    RAM used for my db at the db startup to be sure of not retrieving the records from cache).
    so row size with overhead is 2006 * 290,000 rows = 581740000(bytes) / 1024 = 568105KB / 1024 = 555MB.
    Through this math calculation I thought It will be the total table size. So I Created the same no. of rows in 3 blocksizes.
    If it's wrong then what a mes because I was calculating tables sizes in the same way from the last few months.
    Can you please explain a little how you found out the tables sizes in different block sizes.Though I understood how you
    calculated size in MB from these 3 block sizes
    T8K =97177 BLOCKS=759MB *( 97177*8 = 777416KB / 1024 = 759MB )*
    T16K=41639 BLOCKS=650MB
    BT4K=293656 BLOCKS=1147MB
    For me it's new to calculate the size of a table. Can you please tell me then how many rows I can create in each of
    these 3 tables to make them equal in MB to test for elapsed time.
    Then I'll again run my test and put the results here. Because If I've wrongly calculated table sizes then there is no need to talk about elapsed time. First I must equalize the table sizes properly.
    SQL> select sum(bytes)/1024/1024 "Size in MB" from dba_segments> 2 where segment_name = 'T16K';
    Size in MB
    655
    Is above SQL is correct to calculate the size or is it the correct alternative way to your method of calculating the size??
    I created the same table again with everything same and the result is :
    SQL> select num_rows,blocks from user_tables where table_name = 'T16K';NUM_ROWS BLOCKS
    290000 41703
    64 more blocks are allocated this time so may be that's y it's showing total size of 655 instead of 650.
    Thanks alot for your help.
    Best Regards,
    KAm
    Edited by: kam555 on Nov 20, 2009 5:57 PM

  • Execution time, elapsed time  of an sql query

    Can you please tell me how to get the execution time, elapsed time of an sql query

    user8680248 wrote:
    I am running query in the database
    I would like to know how long the query take the time to completeWhy? That answer can be totally meaningless as the VERY SAME query on the VERY SAME data on the VERY SAME database in the VERY SAME Oracle session can and will show DIFFERENT execution times.
    So why do you want to know a specific query's execution time? What do you expect that to tell you?
    If you mean that you want to know how long an existing query being executed is still going to take - that's usually quite difficult to determine. Oracle does provide a view on so-called long operations. However, only certain factors of a query's execution will trigger that this query is a long operation - and only for those specific queries will there be long operation stats that provide an estimated completion time.
    If your slow and long running query does not show in long operation, then Oracle does not consider it a long operation - it fails to meet the specific criteria and factors required as a long operation. This is not a bug or an error. Simply that your query does not meet the basic requirements to be viewed as a long operation.
    Oracle however provides the developer with the means to create long operations (using PL/SQL). You need to know and do the following:
    a) need to know how many units of work to do (e.g. how many fetches/loop iterations/rows your code will process)
    b) need to know how many units of work thus far done
    c) use the DBMS_APPLICATION_INFO package to create a long operation and continually update the operation with the number of work units thus far done
    It is pretty easy to implement this in PL/SQL processing code (assuming requirements a and b can be met) - and provide long operation stats and estimated completion time for the DBA/operators/users of the database, waiting on your process to complete.

  • Query Execution time - Elapsed time v Actual time taken

    Hi All,
    I have this scenario where I am querying a single table with the following results. It is a very heavy query in that there are multiple aggregate functions and multiple unions on it. Even if the query is written poorly (i doubt it is) why would the actual
    time taken to execute the query be much more than the statistics provided through the following commands?
    SET STATISTICS IO ON;
    SET STATISTICS TIME ON;
    Attached are the stats provided for the relevant query in question.
    Table '123456789_TEMP_DATA'. Scan count 178, logical reads 582048, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.
    Table 'Worktable'. Scan count 0, logical reads 0, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.
    SQL Server Execution Times:
       CPU time = 936 ms,  elapsed time = 967 ms.
    2014-01-06 17:36:41.383
    Now, although the CPU Time/Elapsed time shows that it takes less than a second, it actually takes more than 15 seconds to fetch the results. (This is the actual time that you get on the bottom bar of the Query pane as well.)
    What is the reason? Why is it that there is such a big discrepancy between the numbers? How can I improve this situation?
    Thanks!

    Yes. I am returning a huge number of rows to the client. 
    The query is simply against a single table. 
    Select
     'First Record',AVG(COLUMN1),STDEV(COLUMN1
    ),COUNT(COLUMN1)
    FROM [TABLE1] WHERE (SOME CONDITION)
    UNION ALL
    Select  'Second Record',AVG(COLUMN2),STDEV(COLUMN2),COUNT(COLUMN2) FROM [TABLE1]
    WHERE (SOME OTHER CONDITION)
    Imagine there are 178 records fetched in this manner with 178 UNIONs. The WHERE clause will always change for each SELECT statement.
    Now, the question is not so much about the query itself, but why the execution time is actually 15 seconds whilst the SQL STATISTICS show it to be 936ms (<1 second)
    Thanks!

Maybe you are looking for